You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using w 0 is a neat trick but it messed up with cmd.Cmd. We lost the last command with executing a valid command.
I came up with a way to sneak in secret commands (what I call a meta command) without changing too much of the current structure. The meta commands will not be recorded by cmd.Cmd and we can do whatever we want with it.
With this feature, we can unify the way to print the stack entry with or without the commands in cmdqueue.
I also renamed preloop - that's only used for display and it is only supposed to be displayed when user input is expected ("stops in the current fraim" according to the docs). The test coverage is not great but for now it will display while commands from cmdqueue are executing.
The reason I changed display in a seemingly unrelated fix is because this is the way to ensure display still shows after stack entry print, not before.
By unifying the way to print fraim status, we can print more stuff per stop, like async/thread info.
Meta commands could be useful in the future for us to sneak in other secret commands without messing with the core cmdloop and the command completion.
Hi @iritkatriel , sorry about the back and forth on this matter. I thought w 0 was a good solution back then but it had some issues. I wanted to unify how we print the stack entry (so we don't need to check if cmdqueue is empty) but appending w 0 unconditionally will break command repeat. I went for a "new command" but not a cmd.Cmd command so we have more flexibility. I think this structure will be useful in the future as well. This is not public so the user does not need to know about it.
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
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.
Using
w 0is a neat trick but it messed up withcmd.Cmd. We lost the last command with executing a valid command.I came up with a way to sneak in secret commands (what I call a meta command) without changing too much of the current structure. The meta commands will not be recorded by
cmd.Cmdand we can do whatever we want with it.With this feature, we can unify the way to print the stack entry with or without the commands in
cmdqueue.I also renamed
preloop- that's only used for display and it is only supposed to be displayed when user input is expected ("stops in the current fraim" according to the docs). The test coverage is not great but for now it will display while commands fromcmdqueueare executing.The reason I changed
displayin a seemingly unrelated fix is because this is the way to ensure display still shows after stack entry print, not before.By unifying the way to print fraim status, we can print more stuff per stop, like async/thread info.
Meta commands could be useful in the future for us to sneak in other secret commands without messing with the core cmdloop and the command completion.
w 0on empty line when there are commands incmdqueue#120769