From 7cdfbebc9ee7012809d331cf0a9745c39465004a Mon Sep 17 00:00:00 2001 From: SirBlob Date: Sun, 4 Oct 2026 02:24:47 -0400 Subject: [PATCH] Open new terminals in the current directory --- bin/blob-launch-terminal | 2 ++ bin/blob-terminal-exec | 9 ++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/bin/blob-launch-terminal b/bin/blob-launch-terminal index 4ab9fb1..8920b2d 100755 --- a/bin/blob-launch-terminal +++ b/bin/blob-launch-terminal @@ -3,4 +3,6 @@ # blob:summary=Launch the default terminal # blob:args=[command [args...]] +(( $# == 0 )) && set -- --dir="$(blob-cmd-cwd)" + exec setsid uwsm-app -- blob-terminal-exec "$@" diff --git a/bin/blob-terminal-exec b/bin/blob-terminal-exec index c4dfe85..997b705 100755 --- a/bin/blob-terminal-exec +++ b/bin/blob-terminal-exec @@ -1,7 +1,7 @@ #!/bin/bash # blob:summary=Run a command in the default terminal -# blob:args=[--print-id] [--app-id=] [--title=] [-e] <command> [args...] +# blob:args=[--print-id] [--app-id=<app-id>] [--title=<title>] [--dir=<dir>] [-e] <command> [args...] # blob:hidden=true terminal="" @@ -23,6 +23,7 @@ fi app_id="" title="" +dir="" command_args=() while (( $# > 0 )); do @@ -39,6 +40,10 @@ while (( $# > 0 )); do title=${1#--title=} shift ;; + --dir=*) + dir=${1#--dir=} + shift + ;; -e) shift command_args+=("$@") @@ -56,9 +61,11 @@ launch=("$terminal") case "$terminal" in foot) [[ -n $app_id ]] && launch+=("--app-id=$app_id") + [[ -n $dir ]] && launch+=("--working-directory=$dir") ;; kitty) [[ -n $app_id ]] && launch+=("--class=$app_id") + [[ -n $dir ]] && launch+=("--directory=$dir") ;; esac