-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
How to command-prompt from a shell script? #2499
Comments
You could either 1) write the result into a file and either use |
An option to print result to stdout would be good but I don't know how hard it would be offhand. |
I considered the second option before opening the issue but my main concern is the quoting of shell characters. Seeing as I'll be using command prompt to read shell commands how can I properly escape them before they get passed to |
You can try the |
It may be difficult to use it with the result of |
I have added this to todo list but I wouldn't expect it anytime soon. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Issue description
I'm currently trying to write a script to interactively pipe-panes. Part of this involves asking the user which direction they want the pipe to go (
in, out, both
), followed by the command name and confirming whether they'd like to kill an open pipe.command-prompt
by itself doesn't have a flag to output the result to stdout so I've been trying to do indirectly throughdisplay-message
but It seems to me that thecommand-prompt
command implicitly runs a subshell which captures the output preventing my script from recieving it.For example I have a script
~/tmux-pipe-ctrl
which I've bound to | (bind | $HOME/tmux-pipe-ctrl
) containing this:choice=$(tmux command-prompt -1 -p "Direction (i|o|b):" "display-message -p '%%'")
How do I access the command-prompt result from within my script?
If there's no way (as of yet) I'd like to propose a flag that dumps the prompts result to stdout.
Required information
Please provide the following information:
tmux -V
). tmux next-3.3uname -sp
). Linux unknownecho $TERM
). screen-256colortmux kill-server; tmux -vv new
).The text was updated successfully, but these errors were encountered: