Add tmux inspect sessions
This commit is contained in:
parent
8a6d9d8bc2
commit
38dcb5cf4f
@ -5,6 +5,7 @@ source xdg.nu
|
||||
|
||||
use themes.nu
|
||||
use completions *
|
||||
use inspect
|
||||
#{{- if eq .age_key "age1htqslfl4d5uv76j8eg49u9njqjx5udj9jmg3ujf2gxjjm06z0vqqwz6tlm" }}
|
||||
overlay use work
|
||||
#{{- end }}
|
||||
|
||||
1
dot_config/nushell/lib/inspect/mod.nu
Normal file
1
dot_config/nushell/lib/inspect/mod.nu
Normal file
@ -0,0 +1 @@
|
||||
export use tmux.nu
|
||||
15
dot_config/nushell/lib/inspect/tmux.nu
Normal file
15
dot_config/nushell/lib/inspect/tmux.nu
Normal file
@ -0,0 +1,15 @@
|
||||
# list of tmux sessions
|
||||
export def sessions []: [
|
||||
nothing -> table<record<
|
||||
name: string
|
||||
id: string
|
||||
attached: number
|
||||
windows: number
|
||||
attached_list: list<string>
|
||||
>>
|
||||
] {
|
||||
tmux list-sessions -F "#{session_name}\t#{session_id}\t#{session_windows}\t#{session_attached}\t#{session_attached_list}"
|
||||
| from tsv --noheaders
|
||||
| rename name id windows attached attached_list
|
||||
| update attached_list { split row , }
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user