added cross-reboot session list persistence for abmux

This commit is contained in:
Luxferre
2026-04-25 11:29:00 +03:00
parent 148e5d865d
commit 9144b49aae
+9 -1
View File
@@ -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