Skip pre/post exec events for empty commands (#4829)#7085
Closed
awalgarg wants to merge 1 commit intofish-shell:masterfrom
awalgarg:master
Closed
Skip pre/post exec events for empty commands (#4829)#7085awalgarg wants to merge 1 commit intofish-shell:masterfrom awalgarg:master
awalgarg wants to merge 1 commit intofish-shell:masterfrom
awalgarg:master
Conversation
Member
|
So what are we doing for empty commands? Should we possibly just not be doing anything instead? |
Contributor
Author
|
I do think simply ignoring empty commands altogether should be fine, but felt it might be too big a change. Empty commands are often used to "separate" a bunch of commands from the rest for readability, or for some reason to refresh a prompt with a time indicator etc. This patch simply follows the precedent set from CMD_DURATION to fix the issue with postexec hooks receiving an incorrect duration value. If we are okay with ignoring empty commands altogether, I can just do that then. |
Member
Contributor
Author
|
Thanks, @ridiculousfish! |
awalgarg
added a commit
to awalgarg/dotfiles
that referenced
this pull request
Jul 29, 2020
The weird arg length check is due to bug in fish. Sent a patch to fix it, will be released in fish 3.2.0. Ref: fish-shell/fish-shell#7085
This was referenced Aug 3, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
In the same vein as #4926, firing
fish_preexecandfish_postexecfor empty commands is inconsistent with the way$status,historyand$CMD_DURATIONtreat empty commands.fish_postexec, for example, receives an incorrect value for$CMD_DURATIONwhen an empty command is processed.As suggested in #4829, this patch skips firing of these events for empty commands altogether.
Fixes issue #4829
TODOs: