Description
I have a project where I am working in Python. I'm using pipenv
to manage the environment, which has a feature where if you run pipenv shell
it starts a subshell with everything set up right for the environment. This starts a new TTY.
However, that means that ps ... -t "#{pane_tty}"
returns the "wrong" process list. It returns
PID TTY TIME CMD
92716 ttys001 0:00.85 -bash
96594 ttys001 0:22.72 [/path/to/]Python /usr/local/Cellar/pipenv/2020.11.1
But just ps
alone returns (and you can see vim
running inside /dev/ttys002
)
PID TTY TIME CMD
14445 ttys000 0:00.29 -bash
14803 ttys000 0:00.00 /bin/sh /Users/jyurek/bin/tm [my_project]
14804 ttys000 0:00.01 tmux new-session -As [my_project]
92716 ttys001 0:00.85 -bash
96594 ttys001 0:22.72 [/path/to/]Python /usr/local/Cellar/pipenv/2020.11.1
53522 ttys002 0:19.13 vim [source_file].py
96606 ttys002 0:01.01 /bin/bash -i
8581 ttys003 0:00.33 -bash
61829 ttys003 0:07.61 [/path/to/]Python /usr/local/Cellar/pipenv/2020.11.1
61835 ttys005 0:04.68 /bin/bash -i
The end result is that the is_vim
clause in the pane-switching bindings doesn't return true, so it doesn't send the keys to vim, even though it's the program in the foreground.
I'm not really sure how to fix this, since apparently OSX's ps
can't show the lineage of processes to know that vim
is, in fact, running as an (eventual) sub-process in /dev/ttys001
.