tmux-plugins / tmux-resurrect

Persists tmux environment across system restarts.
MIT License
11.41k stars 424 forks source link

Arrow (->) substitution preserving arguments #468

Closed ktprograms closed 1 year ago

ktprograms commented 1 year ago

I use MacVim, so my vim processes are /opt/homebrew/Cellar/macvim/.../MacOS/Vim, which means that I need to use ~vim->vim in my ressurect-processes. The problem with this is that the files I was editing don't get restored (the process ends up as just vim, when I'd want something like vim main.go).

If there was a way I could match and replace on only the first argument (even regex would be fine), that'd be great!

bruno- commented 1 year ago

Try "~vim->vim *"

ktprograms commented 1 year ago

Thanks, I found that from looking at the code. I'll submit a PR to add it to the docs.

However, there's a small bug. When just vim is used without any arguments, in _get_command_arguments()#124, $pane_full_command is vim and $match is vim, but because the regex needs a trailling space, the match is not removed, and vim vim gets executed.