diff --git a/abmux.sh b/abmux.sh index 7ccecae..7f8585f 100755 --- a/abmux.sh +++ b/abmux.sh @@ -1,5 +1,5 @@ #!/bin/sh -# abmux: a simple terminal session switcher on top of abduco and fzf +# abmux: a simple terminal session switcher on top of abduco, fzf and expect # Created by Luxferre in 2026, released into the public domain FTR='Select a session or create a new one' @@ -9,5 +9,7 @@ while true; do [ "$sname" = 'Quit' ] && break [ "$sname" = 'New' ] && read -r -p 'New session name: ' sname sname="$(echo "$sname" | sed -E 's/^[0-9]+\ -\ //')" - [ -n "$sname" ] && abduco -A "$sname" "$SHELL" + if [ -n "$sname" ]; then + expect -c "spawn abduco -A \"$sname\" $SHELL; send \"\014\"; interact" + fi done