Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
sgherdao opened this issue Mar 14, 2024 · 3 comments
Closed
Labels

Comments

@sgherdao
Copy link

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
Copy link
Member

tony commented Mar 17, 2024

Potentially related: tmux-python/tmuxp#915

@sgherdao
Copy link
Author

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

@tony
Copy link
Member

tony commented Mar 17, 2024

@sgherdao Yes!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants