Compare commits

...

2 commits

Author SHA1 Message Date
Lockszmith (VAST@MacBook)
f77df05a9f Added usage notes for search and launch 2025-07-01 10:30:24 -04:00
Lockszmith (VAST@MacBook)
32190e21c9 Change zellij keybindings because of conflicts 2025-06-26 10:34:14 -04:00
2 changed files with 28 additions and 7 deletions

View file

@ -62,14 +62,27 @@ usage-search() {
" [SILENT=1] [BATCH=1] [QUERY='query syntax'] ${SCRIPT_NAME} search [<options>] <search string>" \ " [SILENT=1] [BATCH=1] [QUERY='query syntax'] ${SCRIPT_NAME} search [<options>] <search string>" \
'' \ '' \
'Usage:' \ 'Usage:' \
' BATCH=1 env/prefix - skip fuzzy search (tv/fzf) UX' \
' SILENT=1 env/prefix - supress teleport prompts' \
' QUERY env/prefix - tsh query syntax' \
' <search string> - tsh --search syntax' \
'' \
'Description:' \
' Perform a search (after making sure user is logged in) on the VAST Data Teleport instance' \
' If a single value is returned, output it. If more results are presented, feed them into' \
' a fuzzy search UI (tv/fzf).' \
'' \
' Can also be used to just generate lists using the BATCH=1 environment variable' \
'' \ '' \
'Examples:' \ 'Examples:' \
" \$ BATCH=1 ${SCRIPT_NAME} search tesla" \ " \$ BATCH=1 ${SCRIPT_NAME} search tesla # show all matches for tesla, without fuzzy search UI" \
' cluster_psnt=VAST-TESLA-AUS-1,hostname=aus08p1vstfs01-cn1-DO-NOT-LOGIN' \ ' cluster_psnt=VAST-TESLA-AUS-1,hostname=aus08p1vstfs01-cn1-DO-NOT-LOGIN' \
' cluster_psnt=VA22374479,hostname=c-0-1' \ ' cluster_psnt=VA22374479,hostname=c-0-1' \
' cluster_psnt=VA22465472,hostname=c-0-1' \ ' cluster_psnt=VA22465472,hostname=c-0-1' \
'' \ '' \
" ${SCRIPT_NAME} search tsh-get tesla " \ " ${SCRIPT_NAME} search tesla,472 # will connect to cluster_psnt=VA22465472,hostname=c-0-1" \
'' \
" ${SCRIPT_NAME} search . # Will present complete list in fuzzy search UI" \
'' ''
exit 2 exit 2
} }
@ -83,6 +96,13 @@ usage-launch() {
'' \ '' \
'Options:' \ 'Options:' \
' --no-mux no multiplexing, even if it exists' \ ' --no-mux no multiplexing, even if it exists' \
'' \
'Description:' \
" 'launch' uses 'search' to locate a host, if a single match is found, it" \
" launches immedietly. If more than one option exists, a fuzzy search UI" \
" will be presented. " \
"" \
" run '${SCRIPT_NAME} search [--help]' for more detail and example searches." \
'' ''
exit 2 exit 2
} }
@ -247,6 +267,7 @@ _do_ssh_with_tunnel() {
_go_launch() { _go_launch() {
local SRCH=() NO_MUX=0 DEST='' ECHO=':' LOGIN='_do_login' local SRCH=() NO_MUX=0 DEST='' ECHO=':' LOGIN='_do_login'
local ZELLIJ_DEST=/tmp/vast-teleport/zellij/teleport local ZELLIJ_DEST=/tmp/vast-teleport/zellij/teleport
[[ -n "$1" ]] || usage-launch
while [[ -n "$1" ]]; do while [[ -n "$1" ]]; do
case $1 in case $1 in
'--help') usage-launch ;; '--help') usage-launch ;;

View file

@ -75,7 +75,7 @@ keybinds clear-defaults=true {
bind "Tab" { ToggleTab; } bind "Tab" { ToggleTab; }
} }
scroll { scroll {
bind "{{ dig "style" "zellij" "leader-modifer" "Alt" . }} s" { SwitchToMode "Normal"; } bind "{{ dig "style" "zellij" "leader-modifer" "Alt" . }} Shift s" { SwitchToMode "Normal"; }
bind "e" { EditScrollback; SwitchToMode "Normal"; } bind "e" { EditScrollback; SwitchToMode "Normal"; }
bind "s" { SwitchToMode "EnterSearch"; SearchInput 0; } bind "s" { SwitchToMode "EnterSearch"; SearchInput 0; }
bind "{{ dig "style" "zellij" "leader-modifer" "Alt" . }} c" { ScrollToBottom; SwitchToMode "Normal"; } bind "{{ dig "style" "zellij" "leader-modifer" "Alt" . }} c" { ScrollToBottom; SwitchToMode "Normal"; }
@ -89,7 +89,7 @@ keybinds clear-defaults=true {
// bind "Alt c" { Copy; } // bind "Alt c" { Copy; }
} }
search { search {
bind "{{ dig "style" "zellij" "leader-modifer" "Alt" . }} s" { SwitchToMode "Normal"; } bind "{{ dig "style" "zellij" "leader-modifer" "Alt" . }} Shift s" { SwitchToMode "Normal"; }
bind "{{ dig "style" "zellij" "leader-modifer" "Alt" . }} c" { ScrollToBottom; SwitchToMode "Normal"; } bind "{{ dig "style" "zellij" "leader-modifer" "Alt" . }} c" { ScrollToBottom; SwitchToMode "Normal"; }
bind "j" "Down" { ScrollDown; } bind "j" "Down" { ScrollDown; }
bind "k" "Up" { ScrollUp; } bind "k" "Up" { ScrollUp; }
@ -117,7 +117,7 @@ keybinds clear-defaults=true {
} }
session { session {
bind "{{ dig "style" "zellij" "leader-modifer" "Alt" . }} o" { SwitchToMode "Normal"; } bind "{{ dig "style" "zellij" "leader-modifer" "Alt" . }} o" { SwitchToMode "Normal"; }
bind "{{ dig "style" "zellij" "leader-modifer" "Alt" . }} s" { SwitchToMode "Scroll"; } bind "{{ dig "style" "zellij" "leader-modifer" "Alt" . }} Shift s" { SwitchToMode "Scroll"; }
bind "d" { Detach; } bind "d" { Detach; }
bind "w" { bind "w" {
LaunchOrFocusPlugin "session-manager" { LaunchOrFocusPlugin "session-manager" {
@ -174,7 +174,7 @@ keybinds clear-defaults=true {
shared_except "locked" { shared_except "locked" {
bind {{ list (dig "style" "zellij" "leader-modifer" "Alt" .) (dig "style" "zellij" "leader-key" "a" .) | join " " | quote }} { SwitchToMode "Locked"; } bind {{ list (dig "style" "zellij" "leader-modifer" "Alt" .) (dig "style" "zellij" "leader-key" "a" .) | join " " | quote }} { SwitchToMode "Locked"; }
bind "{{ dig "style" "zellij" "leader-modifer" "Alt" . }} q" { Quit; } bind "{{ dig "style" "zellij" "leader-modifer" "Alt" . }} q" { Quit; }
bind "Alt Shift f" { ToggleFloatingPanes; } bind "{{ dig "style" "zellij" "leader-modifer" "Alt" . }} Shift f" { ToggleFloatingPanes; }
bind "Alt n" { NewPane; } bind "Alt n" { NewPane; }
bind "Alt i" { MoveTab "Left"; } bind "Alt i" { MoveTab "Left"; }
bind "Alt o" { MoveTab "Right"; } bind "Alt o" { MoveTab "Right"; }
@ -197,7 +197,7 @@ keybinds clear-defaults=true {
bind "{{ dig "style" "zellij" "leader-modifer" "Alt" . }} n" { SwitchToMode "Resize"; } bind "{{ dig "style" "zellij" "leader-modifer" "Alt" . }} n" { SwitchToMode "Resize"; }
} }
shared_except "scroll" "locked" { shared_except "scroll" "locked" {
bind "{{ dig "style" "zellij" "leader-modifer" "Alt" . }} s" { SwitchToMode "Scroll"; } bind "{{ dig "style" "zellij" "leader-modifer" "Alt" . }} Shift s" { SwitchToMode "Scroll"; }
} }
shared_except "session" "locked" { shared_except "session" "locked" {
bind "{{ dig "style" "zellij" "leader-modifer" "Alt" . }} o" { SwitchToMode "Session"; } bind "{{ dig "style" "zellij" "leader-modifer" "Alt" . }} o" { SwitchToMode "Session"; }