Adjusted for updated nushell config specifications

Added global shortcuts for zellij

Signed-off-by: TuDatTr <tuan-dat.tran@tudattr.dev>
This commit is contained in:
TuDatTr
2023-03-20 21:38:00 +01:00
parent e179210bb4
commit b5b511404b
8 changed files with 37 additions and 26 deletions

View File

@@ -20,21 +20,19 @@ if $zellij_session_count == 0 {
"Into Try"
let user_input = ($user_input | into int);
"Converted"
if ($user_input < 0 or $user_input > $zellij_session_count - 1) {
$"User Input: ($user_input)";
$"Threshold: 0-($zellij_session_count - 0)";
$"UserInput in Threshold? (0 < $user_input or $user_input < $zellij_session_count - 1)"
if (0 < $user_input or $user_input < $zellij_session_count - 1) {
"Valid Input"
# Valid session
let table_entry = ($zellij_session_table | select $user_input);
zellij attach $table_entry;
} else {
"Invalid Input"
# Invalid session
# Create new one
zellij;
}
} catch {
"Catch"
zellij;
}
}