Skip to content

Commit 727368a

Browse files
committed
Add method display_message to Pane
1 parent 3417e11 commit 727368a

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

libtmux/pane.py

+19
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,25 @@ def send_keys(self, cmd, enter=True, suppress_history=True):
116116
if enter:
117117
self.enter()
118118

119+
def display_message(self, cmd, get_text=False):
120+
"""
121+
``$ tmux display-message`` to the pane.
122+
123+
Displays a message in target-client status line.
124+
125+
Parameters
126+
----------
127+
cmd : str
128+
Special parameters to request from pane.
129+
get_text : bool, optional
130+
Returns only text without displaying a message in
131+
target-client status line.
132+
"""
133+
if get_text:
134+
return self.cmd('display-message', '-p', cmd).stdout[0]
135+
else:
136+
self.cmd('display-message', cmd)
137+
119138
def clear(self):
120139
"""Clear pane."""
121140
self.send_keys('reset')

0 commit comments

Comments
 (0)