Skip to content
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

Post-prompt command #46

Closed
magicant opened this issue Feb 26, 2024 · 2 comments · Fixed by #49
Closed

Post-prompt command #46

magicant opened this issue Feb 26, 2024 · 2 comments · Fixed by #49
Labels
enhancement New feature or request
Milestone

Comments

@magicant
Copy link
Owner

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.

@magicant magicant added the enhancement New feature or request label Feb 26, 2024
@drawkula
Copy link

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
Copy link

zuzlyck commented Apr 7, 2024

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.

@magicant magicant added this to the 2.57 milestone Apr 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants