I am wondering if it is possible to write a zsh script that will write the command at the invitation, but DO NOT execute it, that is, leave it there for editing and then execute it when I am ready. I can do something similar using keybindings, leaving the final "\ Cm". eg:
bindkey -s "\e[1;3C" "howdy!"
... I press Alt + RightArrow and the text "howdy!" printed in the invitation and just stays there.
I can also do something like what I want by writing my command to the history file and then remembering it with the up arrow. I tried "echo -n sometext" but it does not work.
Can I write a script that will exit the command line (say) "howdy!"? Actually, I want the script to create a complex command based on several things, but I want the script to leave it in the CLI for final editing, so automatic execution should be prevented.
Thanks in advance.
source
share