Assuming you can find it in ps, you can match up ptys: $ emacs ^Z $ ps -otty,pid,command|grep emacs ttyp8 24411 emacs (emacs-25.3) $ tmux lsp -aF '#{pane_tty} #{pane_id}'|grep ttyp8 /dev/ttyp8 %7 $ tmux switch -t %7
On 27 December 2017 at 04:30, 付尧 <j...@thinkingcloud.info> wrote: > Hi, Everyone: > > I have a really simple problem, but haunted me for quite a while. > > I use TMUX in iTerm2 all the time, and I work using NeoVim. > > I'll open a couple of sessions(each for one context, say development for > one > session, temp tests for another session, server management is another > session). > > And I use NeoVim in them all the time. > > Then the problem for me is, after a few days, I will forget which window > did I opened the vim. In many cases, it might get buried into > background(all > the time). > > So, when I try to update the file again, I'll see the nasty warning of > this file is opened by another vim instance, do you really want to open > it message, since it is already have the swap file for it. > > And since I have opened many sessions and windows and panes. It is > really hard for me to find which pane I've opened that Vim. > > The best way that I can think is like this: > > 1. Run `jobs -l` command in all opened panes in all windows in all > sessions of TMUX > 2. Get all results with this format #{session_name} - #{window_name} - > #{pane_id} - #{app_pid} - #{app_command} > > Then, I can filter them out and get to the right pane for it. > > Did you have the same problem as me? So, I can save some time for > writing a script for that, Or I should write a script for that > and share it? > > -- > > Thanks > ============================================================ > ==================== > > Programming For The Future > > Jack > > -- > You received this message because you are subscribed to the Google Groups > "tmux-users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to tmux-users+unsubscr...@googlegroups.com. > To post to this group, send an email to tmux-users@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "tmux-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to tmux-users+unsubscr...@googlegroups.com. To post to this group, send an email to tmux-users@googlegroups.com. For more options, visit https://groups.google.com/d/optout.