Skip to content

Commit 786c831

Browse files
committed
Add optional parameter literal to Pane.send_keys
1 parent ed4aaa9 commit 786c831

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

libtmux/pane.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def cmd(self, cmd, *args, **kwargs):
9494

9595
return self.server.cmd(cmd, *args, **kwargs)
9696

97-
def send_keys(self, cmd, enter=True, suppress_history=True):
97+
def send_keys(self, cmd, enter=True, suppress_history=True, literal=False):
9898
"""
9999
``$ tmux send-keys`` to the pane.
100100
@@ -109,9 +109,15 @@ def send_keys(self, cmd, enter=True, suppress_history=True):
109109
Send enter after sending the input, default True.
110110
suppress_history : bool, optional
111111
Don't add these keys to the shell history, default True.
112+
literal : bool, optional
113+
Send keys literally, default True.
112114
"""
113115
prefix = ' ' if suppress_history else ''
114-
self.cmd('send-keys', prefix + cmd)
116+
117+
if literal:
118+
self.cmd('send-keys', '-l', prefix + cmd)
119+
else:
120+
self.cmd('send-keys', prefix + cmd)
115121

116122
if enter:
117123
self.enter()

0 commit comments

Comments
 (0)