Closed Anomalocaridid closed 2 years ago
so this is not yet supported, right
so this is not yet supported, right
Correct, this enhancement request is still open!
In the nightly build available within 30 mins of this comment being posted, you can do:
wezterm cli send-text "hello"
or:
echo something | wezterm cli send-text
See wezterm cli send-text --help
for more information.
hi @wez
how to get the pane-id
?
When I do wezterm cli list
, I got only 1 record, is this expected ?
I opened 2 tabs and multiples panes after ssh from windows 10 to centos 7 ( https://wezfurlong.org/wezterm/ssh.html )
When I tested without ssh on mac, I got 2 records by just opening a new tab.
@xiangpeng2008: please open a separate issue!
btw, how could I send a enter
or break-line key ?
for example, I want pane 0 to execute echo hello
, but wezterm cli send-text --pane-id 0 "echo hello\n"
doesn't do the job, it just shows
also is there an easy way to know the pane id of specific pane ?
wezterm sets the WEZTERM_PANE
environment variable to the pane id when it launches a pane. The CLI will use that as the pane id if you don't explicitly specify it.
btw, how could I send a
enter
or break-line key ? for example, I want pane 0 to executeecho hello
, butwezterm cli send-text --pane-id 0 "echo hello\n"
doesn't do the job, it just shows
hi @wez , do you have an idea to send an enter
key ?
echo -e "hello\n" | wezterm cli send-text
is probably the easiest way
sorry when I said "enter" I wanted to let my command to be executed, but when I do
echo -e "echo hello\n" | wezterm cli send-text --pane-id 0
The command is not executed, but just have line break after.
same for a python session
echo -e "print(1)\n" | wezterm cli send-text --pane-id 0
btw, is it possible to get current wezterm window id , and wezterm pane id ?
I didn't seem to see them in the env
sorry when I said "enter" I wanted to let my command to be executed, but when I do
echo -e "echo hello\n" | wezterm cli send-text --pane-id 0
The command is not executed, but just have line break after.
fyi this issue only happens for mac, when I connect from windows 10 to centos 7,
echo -e "echo hello\necho world" | wezterm cli send-text --pane-id 7
\n
could serve as enter
Remember you're sending "text" as if you're pasting it. This will be different than "typing". This can be easily seen in Vim.
About newline: try \r
or \r\n
.
385f3c99d3b2311fde1ed494d0d3d327ebdca28b adds a --no-paste
flag to wezterm cli send-text
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Is your feature request related to a problem? Please describe. No.
Describe the solution you'd like I would like the ability to send text to a wezterm pane, given its window, tab, and pane ids, like a window created with
wezterm start
and running an interactive program like a shell in order to execute the text as a command or enter it as some other input.Describe alternatives you've considered I am unaware of any alternatives that give a similar functionality.
Additional context I created a plugin for the text editor Kakoune that aims to provide integration with WezTerm that is similar to the integration that Kakoune provides with other terminal emulators and terminal multiplexers by default. This would allow me to add functionality that is currently missing when compared with the default terminal integration.