alexghergh / nvim-tmux-navigation

Easy Neovim-Tmux navigation, completely written in Lua
MIT License
273 stars 21 forks source link

faster window switching #16

Closed m-fonseca closed 5 months ago

m-fonseca commented 12 months ago

Hello,

I noticed tmux switching was slow for me, which ended up the ps command in 'is_vim' was taking close to 400ms to return (theres something going on with my system but it normally returns around 170ms). In the process of figuring out why it was slow, I noticed pgrep is much faster for this (~50ms), and it made a big difference for me. This is not exactly the same as it doesn't look at the ^TXZ states like the other is_vim does, but it seems to be working for me and I figured I'd share.

is_vim="tty=#{pane_tty} ; pgrep -t \${tty#/dev/} 'g?(view|n?vim?x?)(diff)?$' >/dev/null 2>&1"
isaksamsten commented 11 months ago

Thanks! I had the same issue (Macbook Pro M2), using pgrep solves the slowdown for me as well!

isaksamsten commented 11 months ago

Realised it was due to using Fish shell. It performs very well in bash or zsh.