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

:terminal improvements #5431

Open
7 of 25 tasks
justinmk opened this issue Oct 5, 2016 · 12 comments
Open
7 of 25 tasks

:terminal improvements #5431

justinmk opened this issue Oct 5, 2016 · 12 comments
Assignees
Labels
terminal built-in :terminal or :shell
Milestone

Comments

@justinmk
Copy link
Member

justinmk commented Oct 5, 2016

List of terminal improvements.

@justinmk justinmk added the terminal built-in :terminal or :shell label Oct 5, 2016
@justinmk justinmk added this to the 0.2 milestone Oct 5, 2016
@justinmk justinmk self-assigned this Oct 5, 2016
@AprilArcus
Copy link

AprilArcus commented Nov 2, 2016

I think it would be really cool if terminal could support cmdwin - c.f. brettanomyces/nvim-terminus#7

In particular, this would be great for writing multi-line functions in REPLs.

@justinmk justinmk modified the milestones: 0.3, 0.2 Nov 27, 2016
@bew
Copy link
Contributor

bew commented Dec 2, 2016

would it be possible to handle :set nowrap in terminal buffer ?

@justinmk
Copy link
Member Author

justinmk commented Dec 2, 2016

Yes, by telling libvterm a very long width. I have a pending PR that helps with this.

edit: That hack isn't going to work, because it will confuse interactive applications, not to mention tools like pytest which center text based on the TTY width.

@bew
Copy link
Contributor

bew commented Jan 20, 2017

for the following improvment :

User-initiated :! invocations should silently use :terminal instead

Which terminal should be used ? We could send a RequestTerminal event, and see if a particular variable is set. If it is, use the terminal from the variable, or create a new terminal (new tab ? h/v split ?)

@justinmk
Copy link
Member Author

The details of each item can be discussed as PRs are proposed for them. But at least initially the goal is only to match the traditional semantics of :!, so some sort of long-lived scratch buffer would be used.

justinmk added a commit to justinmk/neovim that referenced this issue Feb 19, 2017
Partial solution to neovim#2637. Will crash if *all* lines are deleted.

References neovim#2607
References neovim#2637
References neovim#5431
justinmk added a commit to justinmk/neovim that referenced this issue Feb 22, 2017
Partial solution to neovim#2637. Will crash if *all* lines are deleted.

References neovim#2607
References neovim#2637
References neovim#5431
justinmk added a commit to justinmk/neovim that referenced this issue Feb 24, 2017
Partial solution to neovim#2637. Will crash if *all* lines are deleted.

References neovim#2607
References neovim#2637
References neovim#5431
justinmk added a commit to justinmk/neovim that referenced this issue Feb 25, 2017
Partial solution to neovim#2637. Will crash if *all* lines are deleted.

References neovim#2607
References neovim#2637
References neovim#5431
justinmk added a commit to justinmk/neovim that referenced this issue Feb 25, 2017
Partial step towards neovim#2637. Will crash if *all* lines are deleted.

Closes neovim#2607
References neovim#5431
justinmk added a commit to justinmk/neovim that referenced this issue Feb 26, 2017
Partial step towards neovim#2637. Will crash if *all* lines are deleted.

Closes neovim#2607
References neovim#5431
@bohrshaw
Copy link
Contributor

bohrshaw commented Feb 27, 2017

Well, I see (the last line of) a terminal buffer could serve as a really flexible readline-like interface, if only we can enter Insert Mode on a terminal buffer.

@justinmk
Copy link
Member Author

@bohrshaw See this thread: #6142 (comment)

justinmk added a commit to justinmk/neovim that referenced this issue Mar 15, 2017
- 'bufhidden=hide' allows intuitive behavior even with global 'nohidden'.
- 'modified' is a natural way to prevent loss of work. And the user can
  set 'nomodified' for cases where they don't want to be prompted.

- With bufhidden={delete,wipe}: terminal buffer is restarted when the
  user returns to a deleted/wiped terminal buffer.

Closes neovim#2368
Closes neovim#3340
References neovim#5431

Remove some special-case checks; instead leverage existing checks for
'bufhidden' (b_p_bh) and 'buftype' (b_p_bt).

TODO:
- With bufhidden=unload, the buffer is blank if the user returns to an
  unloaded terminal buffer. We should instead save the terminal
  scrollback to a file, then reload that.
justinmk added a commit to justinmk/neovim that referenced this issue Mar 19, 2017
- 'bufhidden=hide' allows intuitive behavior even with global 'nohidden'.
- 'modified' is a natural way to prevent loss of work. And the user can
  set 'nomodified' for cases where they don't want to be prompted.

- With bufhidden={delete,wipe}: terminal buffer is restarted when the
  user returns to a deleted/wiped terminal buffer.

Closes neovim#2368
Closes neovim#3340
References neovim#5431

Remove some special-case checks; instead leverage existing checks for
'bufhidden' (b_p_bh) and 'buftype' (b_p_bt).

TODO:
- With bufhidden=unload, the buffer is blank if the user returns to an
  unloaded terminal buffer. We should instead save the terminal
  scrollback to a file, then reload that.
justinmk added a commit to justinmk/neovim that referenced this issue Mar 20, 2017
- 'bufhidden=hide' allows intuitive behavior even with global 'nohidden'.
- 'modified' is a natural way to prevent loss of work. And the user can
  set 'nomodified' for cases where they don't want to be prompted.

- With bufhidden={delete,wipe}: terminal buffer is restarted when the
  user returns to a deleted/wiped terminal buffer.

Closes neovim#2368
Closes neovim#3340
References neovim#5431

Remove some special-case checks; instead leverage existing checks for
'bufhidden' (b_p_bh) and 'buftype' (b_p_bt).

TODO:
- With bufhidden=unload, the buffer is blank if the user returns to an
  unloaded terminal buffer. We should instead save the terminal
  scrollback to a file, then reload that.
@tssm
Copy link

tssm commented Mar 11, 2020

I know that I may loose the argument here, but I think Neovim :terminal behaves the right way already, and I would whish :help and other "special" buffers (e.g. quick fix) behave like it. Here are the reasons:

  1. Vim tabs are actually the right design, each tab is a layout and the user can switch between them easily. When :help (and :copen and probably others that I don't know about) is run the whole point of having different layouts on each tab is lost.
  2. Most commands behave the same, with exceptions, so the user must remember those especial cases to avoid disrupting the layout. Even if something like :0te is implemented (I would prefer something like :current te if it happens), there would be a default behaviour and a bunch of special cases :( I prefer consistency.

One can argue that the user that the user could have custom commands with the desire behaviour, and that's what I do, but it would be awesome if Neovim where more consistent than Vim, so I wouldn't need to remember to use my custom commands instead of the default :help. I don't expect the behaviour of :help to be changed, I know compatibility with Vim is more important, but it would be nice if :terminal was kept as is (plus support for :vertical, :tab and others)

@jcorbin

This comment has been minimized.

@ddickstein
Copy link
Contributor

ddickstein commented Aug 13, 2021

@justinmk can you elaborate on the plan for :read !foo? In the original post you write, ":! should use :terminal internally. Doesn't affect :read !foo etc." and then say ":read :term foo should work like :read !foo" What does this mean? It sounds like :read !foo isn't going to be changed by any of the :! plans, and that :read :term foo is going to be a new supported syntax that will have identical semantics to the current :read !foo. Is that correct?

@clason clason modified the milestones: 0.6, 0.7 Nov 30, 2021
justinmk added a commit to justinmk/neovim that referenced this issue May 16, 2022
vim-patch:8.0.1119: quitting a split terminal window kills the job
N/A, or tracked in neovim#5431

vim-patch:8.0.1307: compiler warning for ignoring return value
N/A

vim-patch:8.0.1335: writefile() using fsync() may give an error
N/A

vim-patch:8.0.1339: no test for what 8.0.1335 fixes
already merged in 5972ff0

vim-patch:8.0.1367: terminal test hangs, executing abcde
N/A

vim-patch:8.0.1562: the terminal debugger can't set breakpoint with mouse
we have all :Termdebug changes

vim-patch:8.0.1609: shell commands in the GUI use a dumb terminal
tracked in neovim#5431

vim-patch:8.0.1616: Win32: shell commands in the GUI open a new console (guioptions="!")
tracked in neovim#1496

vim-patch:8.0.1706: cannot sent CTRL-\ to a terminal window
already possible via :call chansend()
justinmk added a commit that referenced this issue May 16, 2022
vim-patch:8.0.1119: quitting a split terminal window kills the job
N/A, or tracked in #5431

vim-patch:8.0.1307: compiler warning for ignoring return value
N/A

vim-patch:8.0.1335: writefile() using fsync() may give an error
N/A

vim-patch:8.0.1339: no test for what 8.0.1335 fixes
already merged in 5972ff0

vim-patch:8.0.1367: terminal test hangs, executing abcde
N/A

vim-patch:8.0.1562: the terminal debugger can't set breakpoint with mouse
we have all :Termdebug changes

vim-patch:8.0.1609: shell commands in the GUI use a dumb terminal
tracked in #5431

vim-patch:8.0.1616: Win32: shell commands in the GUI open a new console (guioptions="!")
tracked in #1496

vim-patch:8.0.1706: cannot sent CTRL-\ to a terminal window
already possible via :call chansend()
Shougo pushed a commit to Shougo/neovim that referenced this issue May 17, 2022
vim-patch:8.0.1119: quitting a split terminal window kills the job
N/A, or tracked in neovim#5431

vim-patch:8.0.1307: compiler warning for ignoring return value
N/A

vim-patch:8.0.1335: writefile() using fsync() may give an error
N/A

vim-patch:8.0.1339: no test for what 8.0.1335 fixes
already merged in 5972ff0

vim-patch:8.0.1367: terminal test hangs, executing abcde
N/A

vim-patch:8.0.1562: the terminal debugger can't set breakpoint with mouse
we have all :Termdebug changes

vim-patch:8.0.1609: shell commands in the GUI use a dumb terminal
tracked in neovim#5431

vim-patch:8.0.1616: Win32: shell commands in the GUI open a new console (guioptions="!")
tracked in neovim#1496

vim-patch:8.0.1706: cannot sent CTRL-\ to a terminal window
already possible via :call chansend()
dmitmel pushed a commit to dmitmel/neovim that referenced this issue May 18, 2022
vim-patch:8.0.1119: quitting a split terminal window kills the job
N/A, or tracked in neovim#5431

vim-patch:8.0.1307: compiler warning for ignoring return value
N/A

vim-patch:8.0.1335: writefile() using fsync() may give an error
N/A

vim-patch:8.0.1339: no test for what 8.0.1335 fixes
already merged in 5972ff0

vim-patch:8.0.1367: terminal test hangs, executing abcde
N/A

vim-patch:8.0.1562: the terminal debugger can't set breakpoint with mouse
we have all :Termdebug changes

vim-patch:8.0.1609: shell commands in the GUI use a dumb terminal
tracked in neovim#5431

vim-patch:8.0.1616: Win32: shell commands in the GUI open a new console (guioptions="!")
tracked in neovim#1496

vim-patch:8.0.1706: cannot sent CTRL-\ to a terminal window
already possible via :call chansend()
kraftwerk28 pushed a commit to kraftwerk28/neovim that referenced this issue Jun 1, 2022
vim-patch:8.0.1119: quitting a split terminal window kills the job
N/A, or tracked in neovim#5431

vim-patch:8.0.1307: compiler warning for ignoring return value
N/A

vim-patch:8.0.1335: writefile() using fsync() may give an error
N/A

vim-patch:8.0.1339: no test for what 8.0.1335 fixes
already merged in 5972ff0

vim-patch:8.0.1367: terminal test hangs, executing abcde
N/A

vim-patch:8.0.1562: the terminal debugger can't set breakpoint with mouse
we have all :Termdebug changes

vim-patch:8.0.1609: shell commands in the GUI use a dumb terminal
tracked in neovim#5431

vim-patch:8.0.1616: Win32: shell commands in the GUI open a new console (guioptions="!")
tracked in neovim#1496

vim-patch:8.0.1706: cannot sent CTRL-\ to a terminal window
already possible via :call chansend()
justinmk added a commit to justinmk/neovim that referenced this issue Jun 30, 2022
- 'bufhidden=hide' allows intuitive behavior even with global 'nohidden'.
- 'modified' is a natural way to prevent loss of work. And the user can
  set 'nomodified' for cases where they don't want to be prompted.

- With bufhidden={delete,wipe}: terminal buffer is restarted when the
  user returns to a deleted/wiped terminal buffer.

Closes neovim#2368
Closes neovim#3340
References neovim#5431

Remove some special-case checks; instead leverage existing checks for
'bufhidden' (b_p_bh) and 'buftype' (b_p_bt).

TODO:
- With bufhidden=unload, the buffer is blank if the user returns to an
  unloaded terminal buffer. We should instead save the terminal
  scrollback to a file, then reload that.
justinmk added a commit to justinmk/neovim that referenced this issue Oct 21, 2022
There are 6 remaining 8.0.x patches, tracked in:
neovim#5431
justinmk added a commit that referenced this issue Oct 21, 2022
There are 6 remaining 8.0.x patches, tracked in:
#5431
dundargoc pushed a commit to dundargoc/neovim that referenced this issue Jan 15, 2023
There are 6 remaining 8.0.x patches, tracked in:
neovim#5431
@bfredl bfredl modified the milestones: 0.9, 0.10 Feb 2, 2023
glacambre added a commit to glacambre/neovim that referenced this issue Feb 23, 2023
This commit enables piping the current buffer's content to a job running
in a terminal with `:%term job`. It does so in a way that makes the old
`:%term sudo tee` trick work again.

Closes neovim#22157
Maybe good enough to close neovim#12103
Relates to neovim#5431
@tmillr
Copy link
Contributor

tmillr commented Sep 21, 2023

terminal windows in a session are not properly restored

It'd be cool if there were the option (e.g. maybe something in 'sessionoptions') to have scrollback restored (or an api to be able to do this manually, like get and set scrollback functions). By default, manpages don't get restored correctly either last I checked.

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

No branches or pull requests