tmux-python/libtmux

`pane.send_keys()` doesn't send cmd to correct pane when cmd has a `-t` flag

sgherdao opened this issue · 3 comments

Hi @tony,

I am using pane.send_keys() with ssh and its -t flag (Force pseudo-terminal allocation.)
The command is not sent to the correct target pane, but to the current active pane.

It looks like it is related to the following commit:
#ee8a7054
startswith vs in

The below code should be sufficient to reproduce the problem

import libtmux

tmux_server = libtmux.server.Server()
tmux_session = tmux_server.new_session(session_name="repro")
tmux_window = tmux_session.windows[0]
pane = tmux_window.panes[0]
# this will not work
pane.send_keys("ssh -t user@notworking")
# this works
pane.send_keys("ssh user@working")

Thanks,

tony commented

Potentially related: tmux-python/tmuxp#915

Thanks again for the quick fix and for libtmux and tmuxp @tony 🤘