Closed keks24 closed 1 year ago
Hi @keks24, I certainly appreciate the attempts to clean things up, but unfortunately I believe this would be a regression around the handling of subprocesses (e.g. a git alias / subcommand that spawns vim). The use of ps
was introduced a while back to handle the subprocess consideration and I'd not want to break that functionality.
More generally, while I definitely appreciate the attempts to clean things up and make things more efficient, I'm unlikely to merge a sweeping change like this to the core Vim detection logic. My primary goal these days is to keep things stable and a change like this would require a ton of testing (in addition to the more pointed concerns outlined above).
With all that in mind, I'm going to close this now.
I see!
At least it is documented here and others might still have a use of it. :)
-Keks
Absolutely! And the nice thing is that this part is easily swappable by folks so they can grab it if they specifically looking for the efficiency gains 🙂
Resolves #300 and should also resolve #295.
This pull-request uses:
#{version}
to determine thecurrent tmux version
1Else clauses
forif-shell
2display-message -p
to output the version inbash
3printf
,sort
andhead
to check, if thecurrent tmux version
is higher, than3.0
. The last two commands come from the packagecoreutils
, which has more portability, thanbc
.vi
detection logic uses apseudo substring match
by substitutingg?(view|n?vim?x?)(diff)?$
from#{pane_current_command}
.4Also everything is refactored to use internal macros and commands as much as possible to cause less load and invoking less subshells.
I was not sure about the
vim
-part, but left a comment there with a snippet, which could be used.I adapted everything by logic and tested only certain parts of the plugin.
-Ramon
1 See
CHANGES FROM 2.3 TO 2.4, 20 April 2017
https://github.com/tmux/tmux/blob/master/CHANGES2 See
CHANGES FROM 1.5 TO 1.6, 23 January 2012
https://github.com/tmux/tmux/blob/master/CHANGES3 See
CHANGES FROM 1.1 TO 1.2, 10 March 2010
https://github.com/tmux/tmux/blob/master/CHANGES4 See
CHANGES FROM 2.1 TO 2.2, 10 April 2016
https://github.com/tmux/tmux/blob/master/CHANGES