This repository has been archived by the owner on Jun 4, 2024. It is now read-only.
Improved tmux 1.5 integration; no more window renaming #14
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.
Hello again,
Since I've been using screen.vim daily for Clojure coding in the past
weeks, I decided to implement a solution for the tmux window-switching
problem that does not involve setting the window titles.
Quick testing shows that sending from vim -> shell works no matter where
vim or the shell is located, and continues to work if you move both of
them to new locations. I don't use MacVim regularly, but the external
Terminal.app integration also seems to work quite well.
The patch header is below, but I should mention here that the
window-switching does not work in tmux 1.4 and below. It would be easy
to re-add the window-renaming solution for older tmux versions if it's
important to you (so please let me know). However, older tmux versions
still work if the user is careful not switch windows or re-arrange the
shell pane.
Cheers,
Sung
Currently, screen.vim uses a magic window title to determine which
window contains the shell pane. This is fragile, mildly annoying, and
also not necessary in Tmux 1.5 (released July 2011).
tmux list-panes
gained an-a
flag in the latest version, which listsall windows along with their unique pane ids. This list can be grepped
to determine the window index of a pane if the unique pane id is known.
First we remove or noop all instances in which we would have set a tmux
window title. Then, we extract and consolidate all calls to select-pane
or select-window into a new method s:screenTmux:focusPane() [1], which
implements the new behavior.
This commit breaks compatibility with tmux 1.4.
[1]: I did not overload s:screenTmux:focus(), because that would have
violated the arity parity with s:screenGnuScreen:focus()