magicant / yash

Yet another shell
http://magicant.github.io/yash/
GNU General Public License v2.0
346 stars 30 forks source link

Post-prompt command #46

Closed magicant closed 7 months ago

magicant commented 9 months ago

The $PROMPT_COMMAND variable can be used to execute arbitrary commands just before beginning command line input, but the ability to execute commands immediately after completion of input has not existed to date. Providing such a functionality would allow more complex user scripts to be executed, such as measuring the execution time of the entered command.

Something like $POST_PROMPT_COMMAND would be useful for this purpose.

drawkula commented 9 months ago

E.g. to get the prompt or part of it (as fits) into the window title or set the screen/tmux buffer name accordingly. I assume having access to the command entered at that time.

zuzlyck commented 7 months ago

On bash you can also set $PS0 or do trap 'command' DEBUG and set command to whatever you want. None of these exist in yash currently sadly. It would also be nice if you could set a command to be run no matter what after pressing enter (if i recall correctly in bash you can bind enter to achieve this but once again this functionality does not exist in yash) and that would enable you to make a transient prompt.