add command g to switch shell quickly (#4014)

Signed-off-by: Tw <tw19881113@gmail.com>
This commit is contained in:
Tw
2021-09-17 17:39:14 +08:00
committed by GitHub
parent bd0baa961c
commit 1297499d7a
6 changed files with 70 additions and 0 deletions

View File

@ -28,6 +28,8 @@ pub enum CommandAction {
PreviousShell,
/// Go to the next shell in the shell ring buffer
NextShell,
/// Jump to the specified shell in the shell ring buffer
GotoShell(usize),
/// Leave the current shell. If it's the last shell, exit out of Nu
LeaveShell(i32),
}
@ -51,6 +53,7 @@ impl PrettyDebug for CommandAction {
CommandAction::AddPlugins(..) => DbgDocBldr::description("add plugins"),
CommandAction::PreviousShell => DbgDocBldr::description("previous shell"),
CommandAction::NextShell => DbgDocBldr::description("next shell"),
CommandAction::GotoShell(_) => DbgDocBldr::description("goto shell"),
CommandAction::LeaveShell(_) => DbgDocBldr::description("leave shell"),
CommandAction::UnloadConfig(cfg) => {
DbgDocBldr::description(format!("unload config {:?}", cfg))