From 36bd56bcc48c6818802fe177debaf98cdda25d3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Gremaud?= Date: Mon, 2 Sep 2024 19:45:42 +0200 Subject: [PATCH] Update tmux-pane-selection scripts to be more clear --- tmux_select_pane.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tmux_select_pane.py b/tmux_select_pane.py index f2ad688..75181dc 100644 --- a/tmux_select_pane.py +++ b/tmux_select_pane.py @@ -21,7 +21,7 @@ commands = defaultdict(list) all_tty = [p.pane_tty for p in srv.panes] -cmd = f"-t {' -t '.join(all_tty)} -o pid:10 -o tty:10 -o command -ww -f" +cmd = f"-t {' -t '.join(all_tty)} -o pid:10 -o tty:10 -o command -ww" # -f sh_commands = sh.ps(cmd.split(' ')).stdout.decode().strip().split("\n") @@ -55,7 +55,10 @@ def format_pane(pane): else: cmd = {"pid": "-", "command": "*command not found*"} - return [f"{pane.pane_tty}: [Sess:{pane.session_name}, Win:{pane.window_name}] (cwd:{pane.pane_current_path.replace('/home/legrems/', '~/')}): {cmd['command']}"] + path = pane.pane_current_path.replace("/home/legrems/Documents/Arcanite", "~/D/A") + path = path.replace("/home/legrems/Documents", "~/D") + path = path.replace("/home/legrems", "~") + return [f"{pane.pane_tty}: [{pane.session_name}: {pane.window_name}, {path}]: {cmd['command']}"] panes = []