Skip to content

Do not send-keys literally by default #88

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
ritiek opened this issue Dec 26, 2017 · 4 comments · Fixed by #121
Closed

Do not send-keys literally by default #88

ritiek opened this issue Dec 26, 2017 · 4 comments · Fixed by #121
Labels

Comments

@ritiek
Copy link
Contributor

ritiek commented Dec 26, 2017

I noticed that libtmux sends keys to a window pane literally. A minimal reproduction:

import libtmux

server = libtmux.Server()
session = server.new_session('happy_session')
window = session.new_window('happy_window')
pane = window.attached_pane

# instead of KeyboardInterrupt, libtmux sends 'C-c'
pane.send_keys('C-c')

tmux uses -l to specifiy if the keys are to be sent literally:

# not literally
tmux send-keys -t happy_session C-c

# literally
tmux send-keys -l -t happy_session C-c

It would be nice if there were an option to override this behavior in libtmux and preferably set as defaults Pane.send_keys(literal=False) just as in tmux.

@ritiek
Copy link
Contributor Author

ritiek commented Dec 26, 2017

I was messing around a bit and I think I figured what's going on.

libtmux prefixes the command with a blank space, so special events like C-c become <space>C-c which causes tmux to take it literally.

A workaround for the moment would be to pass suppress_history=False in Pane.send_keys().

@ritiek
Copy link
Contributor Author

ritiek commented Dec 30, 2017

The problem still remains about sending keys literally while suppress_history=False.

@stale
Copy link

stale bot commented Feb 28, 2018

This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.

This bot is used to handle issues where the issue hasn't been discussed or
has gone out of date. If an issue isn't resolved and handled in a certain
period of time, it may be closed. If you would like your issue re-opened,
please create a fresh issue with the latest, up to date information and
mention this issue in it.

@stale stale bot added the stale label Feb 28, 2018
@tony tony added pinned and removed stale labels Mar 4, 2018
@tony
Copy link
Member

tony commented Mar 4, 2018

I'm pinning this.

Sorry for the late response, I am having issues keeping up with the project. I'm seeking maintainers @ tmux-python/tmuxp#290. If you (or someone you know) may be interested in helping maintain libtmux or tmuxp, feel free to contact me by email or in the tmux-python/tmuxp#290 issue.

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

Successfully merging a pull request may close this issue.

2 participants