Open
Conversation
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Prerequisites
Description
This is the 2nd feature on top of the Feat/zsh transient multiline #7360 PR
This feature adds a new status flag .Interrupted that can be used e.g. in transient_template:
I have a transient command that shows the command and the return code if it is non-zero:
The problem is that in quick typing I sometimes interrupt the command with Ctrl-C, which then sometimes can not be differentiated from the submitted but failed commands. To be able to differentiate them, I'm adding a new state which then can be used in the transient_template for this reason, e.g.:
With this, you can easily see which commands were interrupted:
Note: the reason of the status flag and template usage showing ^C in front of the command instead of having ^C in the position where it was pressed is because sometimes in lazy mode - especially with long multi-line commands - I prefer to be able to copy part of the previously interrupted command, which would be hard if the ^C would be in the middle of the command messing it up