Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(terminal)!: open :terminal in a split by default #24914

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gpanders
Copy link
Member

With a bang [!], :terminal opens a terminal buffer in the current window, discarding any changes to the current buffer unless 'hidden' is set (which it is by default as of #15410).

This is a BREAKING CHANGE.


Note this reverts some of the changes from #15427 (notably the doc changes to |:horizontal| and the news.txt update from that PR).

With a bang [!], :terminal uses the old behavior.

This is a BREAKING CHANGE.
@gpanders gpanders force-pushed the terminal-split-default branch from 25f3b08 to b183be6 Compare August 28, 2023 15:35
@asmodeus812
Copy link

asmodeus812 commented Aug 29, 2023

I find this defaulting to a split strange, given the fact you can prefix the term with mods for a split direction (i.e vert term and hor term), why then default to split. What is the point ?

@gpanders
Copy link
Member Author

I find this defaulting to a split strange, given the fact you can prefix the term with mods for a split direction (i.e vert term and hor term),

Until 14 hours ago, no you could not.

Regardless, the point is that the more user friendly behavior should be the default. “Sane defaults” is one of the core philosophies and design drivers of the entire Neovim project. There are many issues with the current :term behavior of consuming the current window (I know, because I see the same questions being asked repeatedly).

There are valid use cases for the existing behavior, and for those :term! and termopen() are still available.

@asmodeus812
Copy link

Well In case it wasn't obvious, i was referring to exactly those changes.

Still, the question stands, i am not convinced by your argument at all, sane defaults is the cop out answer, as both are equally valid. I argue that term has no reason to split the current window by default. As it does more than what is expected imo.

@tssm
Copy link

tssm commented May 22, 2024

I know I may lose this battle, but implicitly splitting windows has never been a sane default to me, the tab layout should be decided explicitly by the user IMO. Even :help is disruptive, and I had to script it a bit to stop opening a split. I guess it behaves the way it does because :hidden had to be set by the user, but that's not the case anymore, so having commands that behave different it's just annoying.

This is just a summary of what I said here. Again, I expect to lose this battle, but at least I tried 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change terminal built-in :terminal or :shell
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants