added cross-reboot session list persistence for abmux
This commit is contained in:
@@ -2,9 +2,17 @@
|
|||||||
# abmux: a simple terminal session switcher on top of abduco, fzf and expect
|
# abmux: a simple terminal session switcher on top of abduco, fzf and expect
|
||||||
# Created by Luxferre in 2026, released into the public domain
|
# Created by Luxferre in 2026, released into the public domain
|
||||||
|
|
||||||
|
SPFILE="$HOME/.absess"
|
||||||
|
touch "$SPFILE"
|
||||||
|
if [ -z "$(abduco | tail -n +2)" ]; then
|
||||||
|
cat "$SPFILE" | while read -r sess; do
|
||||||
|
abduco -n "$sess" $SHELL
|
||||||
|
done
|
||||||
|
fi
|
||||||
FTR='Select a session or create a new one'
|
FTR='Select a session or create a new one'
|
||||||
while true; do
|
while true; do
|
||||||
slist="$(abduco | tail -n +2 | cut -f 3 | nl -nln -w1 -s' - ')"
|
abduco | tail -n +2 | cut -f 3 | sort -u > "$SPFILE"
|
||||||
|
slist="$(nl -nln -w1 -s' - ' "$SPFILE")"
|
||||||
sname="$(printf '%s\nNew\nQuit\n' "${slist}" | grep . | fzf --tac --footer="$FTR")"
|
sname="$(printf '%s\nNew\nQuit\n' "${slist}" | grep . | fzf --tac --footer="$FTR")"
|
||||||
[ "$sname" = 'Quit' ] && break
|
[ "$sname" = 'Quit' ] && break
|
||||||
[ "$sname" = 'New' ] && read -r -p 'New session name: ' sname
|
[ "$sname" = 'New' ] && read -r -p 'New session name: ' sname
|
||||||
|
|||||||
Reference in New Issue
Block a user