-
Notifications
You must be signed in to change notification settings - Fork 232
Equivalence to send-keys without hitting 'enter' #293
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
Comments
Hi, We have it in libtmux ( http://libtmux.git-pull.com/en/latest/api.html#libtmux.Pane.send_keys You could suggest a Pull Request. It may be good to know what you think the markup would look like in the config for a command that's not entered fully. |
Hi, @tony Thanks for your reply. I am migrating some of my tmuxifier layouts to tmuxp yaml. There is an option to execute command (run_cmd) or paste command only (send_keys) to the pane in tmuxifier. In my scenario, I found the send_keys command is useful for resource-consuming commands and requires further confirmation to execute, i.e. linux perf commands. I like having those commands automated with tmuxifier / tmup due to complexity of cli arguments. I might be able to help providing a PR, if there is any guideline to dev for this project. Regards, |
I think before a PR, we should discuss what a command without hitting enter should look like in the YAML/JSON config. It should be something unambiguous. By the way, (as a temporary workaround), have you try making your last command have e.g. session_name: unreturned command
windows:
- window_name: my test window
panes:
- shell_command:
- echo first command
- echo have last command unsent \ Then you can hit idea: We could also make the default behavior of a |
Hi, Adding backslash at the end of command line seems to work all right. I see your points now. The original idea of mine was simply to add another command syntax i.e. paste_command (internally calling libtmux.send_keys with enter=False), solely for this purpose. I haven not considered the scenario of executing list of commands. However, from my own use case, the purpose is not to 'execute' the command, but to 'prepare' it. Thus, it is not necessary to follow the form of performing list of commands as shell_command does, perhaps? Regards, |
This issue has been automatically marked as stale because it has not had This bot is used to handle issues where the issue hasn't been discussed or |
Hi I was also looking for something similar to what the OP wanted. I'm just wondering if the mentioned API
ever exposed in Thanks for this wonderful tool eitherway! |
At least the rate at which people are finding this ticket is increasing.... |
@bedge I will look at this. Have you tried the backslash thing from here? #293 (comment) I'm surprised we don't have this added @soraxas @mcfongtw @bedge and anyone else interested: Any suggestion of what a command without Perhaps: - cmd: echo 'hello'
send_keys: false Also, has anyone tried literal style with tmux before? https://yaml.org/spec/1.2/spec.html#id2795688, https://stackoverflow.com/a/38747606 Folded block style? https://yaml.org/spec/1.2/spec.html#id2796251, https://stackoverflow.com/a/47018417 Side note: Outside this issue, if anyone would like to add some doc examples using folded block and and literal styles, that'd be welcomed :) |
My use case is a bit different as I'm not looking to feed keys to a shell, but rather to the tmux instance. eg: connect to some number of slaves, then perform some common tasks.
The after_commands bit would affect all open windows because of the Even better would be some embedded
Granted the I suppose this could be done kicking off an expect script within each shell session with no tmuxp changes. |
@mcfonttw This is a good suggestion As a next step I am moving this to the oldest issue to consolidate things: #53 |
|
Hi,
I am really impressed with the flexibility of this tool working cohesively with tmux. Good work!
I have tried shell_command / shell_command_before, and both of them would execute the command immediately. I am just wondering if there is / will be a syntax that supports send-key without hitting the 'enter'? This might be useful when we have some heavy-weight command ready, but do not execute it unless user specifically hit 'enter'.
Thanks!
The text was updated successfully, but these errors were encountered: