Skip to content

Commit 62394fb

Browse files
committed
env: Harden running commands in tmux so failures are obvious
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
1 parent a786218 commit 62394fb

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

configs/tmux/.tmux.conf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ bind-key c new-window dbxe
44
bind-key C new-window
55

66
# open specific distrobox container using N
7-
bind-key N command-prompt -p "distrobox container:" "new-window 'dbxe %1'"
7+
bind-key N command-prompt -p "distrobox container:" "new-window 'dbxe %1; or exec fish -l'"
88
bind-key E command-prompt -p "new ephemeral distrobox container:" "new-window 'dbxeph %1'"
99

1010
# run commands in either host or distrobox
11-
bind-key r command-prompt -p "run command (distrobox):" "new-window 'dbxe -- fish -c \"%1\"'"
12-
bind-key R command-prompt -p "run command (host):" "new-window '%1'"
11+
bind-key r command-prompt -p "run command (distrobox):" "new-window 'dbxe -- fish -c \"begin; %1; end; or exec fish -l\"; or exec fish -l'"
12+
bind-key R command-prompt -p "run command (host):" "new-window 'begin; %1; end; or exec fish -l'"
1313

1414
# split panes using | and - (distrobox) and H and V (host)
1515
bind-key | split-window -h dbxe

python/scripts/tmxrun.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@
4949
if args.detach:
5050
tmx_cmd.append('-d')
5151

52-
CMD_STR = ' '.join(args.args)
52+
CMD_STR = f"begin; {' '.join(args.args)}; end; or exec fish -l"
5353
if mode == 'container':
54-
CMD_STR = f"dbxe -- fish -c '{CMD_STR}'"
54+
CMD_STR = f"dbxe -- fish -c '{CMD_STR}'; or exec fish -l"
5555
tmx_cmd.append(CMD_STR)
5656

5757
lib.utils.run(tmx_cmd)

0 commit comments

Comments
 (0)