Improve terminal buffer display and toggling ability #123
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
Improve the display of terminal buffers to be a uniform
/current/working/directory/!PID:shellName
on Vim and Neovim.Enable the ability to toggle the showing of terminal buffers (via the
X
command).Details
Terminal buffer display format
On Neovim, terminal buffers are named as:
On Vim, the name contains only a
!
and the shell path:In order to sort by
fullpath
in a more useful manner, synthesize a path for terminal buffers based on the shell's current working directory. Display the shell's name without leading path for brevity. Terminal buffers are now displayed with this format:At present, the current working directory of the shell can be determined only on Unix-like systems having a
/proc
filesystem. For other systems, fall back to the directory at terminal launch for Neovim, or else on Vim's current working directory.It appears to be difficult to determine the current working directory of a program on Windows given the PID, so no attempt is made to determine it for that platform.
Toggling the showing of terminal buffers
When the feature to toggle showing terminal buffers was introduced, a mapping was added for
H
to perform this toggling in the BufExplorer window; however, the key was inoperable because BufExplorer immediately remapped it (along with some other movement keys).Because movement keys such as
H
are valuable for navigating the BufExplorer window, theH
mapping has been changed to useX
instead, asX
is normally an editing feature that's not needed in the BufExplorer window. In addition, this command has been documented.If a different key (or even no key at all) is preferred for this toggling feature, I'd be happy to adjust the pull request accordingly.