Skip to content

Shell commands have a " " prefixed, breaking (some) history #730

@klausman

Description

@klausman

Step 1: Provide a summary of your problem

All commands in a YAML file have a " " (space, 0x20) prefixed, which breaks history for people who have bash set to omit space-prefixed commands form history. If I wanted that, specifying a space in the config would be the thing to do.

Step 2: Provide tmuxp details

  • Include output of tmuxp debug-info
$ tmuxp debug-info
-------------------------
environment:
   dist: Linux-5.15.0-2-amd64-x86_64-with-glibc2.33
   arch: x86_64
   uname: Linux; workdog; 5.15.0-2-amd64
   version: #1 SMP Debian 5.15.5-2 (2021-12-18)
-------------------------
python version: 3.9.9 (main, Jan 10 2022, 10:55:59)  [GCC 11.2.0]
system PATH: /home/klausman/.local/bin:/usr/lib/go-1.8/bin:/home/klausman/go/bin:/home/klausman/bin:/home/klausman/.local/bin:/usr/games:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/sbin:/usr/sbin:/usr/games/bin
tmux version: 3.2
libtmux version: 0.10.1
tmuxp version: 1.9.2
tmux path: /usr/bin/tmux
tmuxp path: /usr/lib/python3/dist-packages/tmuxp/__init__.py
shell: /bin/bash
-------------------------
tmux sessions:
   shorthands: 1 windows (created Fri Jan 14 14:38:10 2022) (attached)

tmux windows:
   0: long form* (3 panes) [82x24] [layout 786d,82x24,0,0[82x13,0,0,8,82x4,0,14,9,82x5,0,19,10]] @5 (active)

tmux panes:
   0: [82x13] [history 0/10000, 6516 bytes] %8 (active)
   1: [82x4] [history 0/10000, 3228 bytes] %9
   2: [82x5] [history 0/10000, 3260 bytes] %10

tmux global options:
   activity-action none
   assume-paste-time 1
   base-index 0
   bell-action any
   default-command ''
   default-shell /bin/bash
   default-size 80x24
   destroy-unattached off
   detach-on-destroy on
   display-panes-active-colour red
   display-panes-colour blue
   display-panes-time 1000
   display-time 750
   history-limit 10000
   key-table root
   lock-after-time 0
   lock-command "lock -np"
   message-command-style bg=black,fg=yellow
   message-style bg=yellow,fg=black
   mouse off
   prefix C-a
   prefix2 None
   renumber-windows off
   repeat-time 500
   set-titles on
   set-titles-string "#T"
   silence-action other
   status on
   status-bg black
   status-fg white
   status-format[0] "#[align=left range=left #{status-left-style}]#[push-default]#{T;=/#{status-left-length}:status-left}#[pop-default]#[norange default]#[list=on align=#{status-justify}]#[list=left-marker]<#[list=right-marker]>#[list=on]#{W:#[range=window|#{window_index} #{window-status-style}#{?#{&&:#{window_last_flag},#{!=:#{window-status-last-style},default}}, #{window-status-last-style},}#{?#{&&:#{window_bell_flag},#{!=:#{window-status-bell-style},default}}, #{window-status-bell-style},#{?#{&&:#{||:#{window_activity_flag},#{window_silence_flag}},#{!=:#{window-status-activity-style},default}}, #{window-status-activity-style},}}]#[push-default]#{T:window-status-format}#[pop-default]#[norange default]#{?window_end_flag,,#{window-status-separator}},#[range=window|#{window_index} list=focus #{?#{!=:#{window-status-current-style},default},#{window-status-current-style},#{window-status-style}}#{?#{&&:#{window_last_flag},#{!=:#{window-status-last-style},default}}, #{window-status-last-style},}#{?#{&&:#{window_bell_flag},#{!=:#{window-status-bell-style},default}}, #{window-status-bell-style},#{?#{&&:#{||:#{window_activity_flag},#{window_silence_flag}},#{!=:#{window-status-activity-style},default}}, #{window-status-activity-style},}}]#[push-default]#{T:window-status-current-format}#[pop-default]#[norange list=on default]#{?window_end_flag,,#{window-status-separator}}}#[nolist align=right range=right #{status-right-style}]#[push-default]#{T;=/#{status-right-length}:status-right}#[pop-default]#[norange default]"
   status-format[1] "#[align=centre]#{P:#{?pane_active,#[reverse],}#{pane_index}[#{pane_width}x#{pane_height}]#[default] }"
   status-interval 15
   status-justify left
   status-keys emacs
   status-left "[#h]"
   status-left-length 10
   status-left-style default
   status-position bottom
   status-right ''
   status-right-length 40
   status-right-style default
   status-style bg=green,fg=black
   update-environment[0] DISPLAY
   update-environment[1] KRB5CCNAME
   update-environment[2] SSH_ASKPASS
   update-environment[3] SSH_AUTH_SOCK
   update-environment[4] SSH_AGENT_PID
   update-environment[5] SSH_CONNECTION
   update-environment[6] WINDOWID
   update-environment[7] XAUTHORITY
   visual-activity off
   visual-bell off
   visual-silence off
   word-separators " "

tmux window options:
   aggressive-resize off
   allow-rename off
   alternate-screen on
   automatic-rename on
   automatic-rename-format "#{?pane_in_mode,[tmux],#{pane_current_command}}#{?pane_dead,[dead],}"
   clock-mode-colour blue
   clock-mode-style 24
   copy-mode-match-style bg=cyan,fg=black
   copy-mode-current-match-style bg=magenta,fg=black
   copy-mode-mark-style bg=red,fg=black
   main-pane-height 24
   main-pane-width 80
   mode-keys emacs
   mode-style bg=yellow,fg=black
   monitor-activity on
   monitor-bell on
   monitor-silence 0
   other-pane-height 0
   other-pane-width 0
   pane-active-border-style "#{?pane_in_mode,fg=yellow,#{?synchronize-panes,fg=red,fg=green}}"
   pane-base-index 0
   pane-border-format "#{?pane_active,#[reverse],}#{pane_index}#[default] \"#{pane_title}\""
   pane-border-lines single
   pane-border-status off
   pane-border-style default
   remain-on-exit off
   synchronize-panes off
   window-active-style default
   window-size latest
   window-style default
   window-status-activity-style "fg=white bg=black"
   window-status-bell-style "fg=white bg=black"
   window-status-current-format "#I:#W#{?window_flags,#{window_flags}, }"
   window-status-current-style "bg=white fg=black"
   window-status-format "#I:#W#{?window_flags,#{window_flags}, }"
   window-status-last-style "fg=white bg=black"
   window-status-separator " "
   window-status-style default
   wrap-search on
   xterm-keys on

Step 3: Describe the problem:

Steps to reproduce:

~ $ cat bla.yaml 
session_name: shorthands
windows:
  - window_name: long form
    panes:
    - shell_command:
      - echo 'did you know'
      - echo 'you can inline'
    - shell_command: echo 'single commands'
    - echo 'for panes'
$ tmuxp load bla.yaml

Observed Results:

  • What happened? This could be a description, log output, etc.
 echo 'did you know'
 echo 'you can inline'
workdog ~ $  echo 'did you know'
did you know
workdog ~ $  echo 'you can inline'
you can inline
workdog ~ $ 






──────────────────────────────────────────────────────────────────────────────────
 echo 'single commands'
workdog ~ $  echo 'single commands'
single commands
workdog ~ $ 
──────────────────────────────────────────────────────────────────────────────────
 echo 'for panes'
workdog ~ $  echo 'for panes'
for panes
workdog ~ $ 

[workdog]0:long form*           ```
#### Expected Results:
  * What did you expect to happen?

#### Relevant Code:

Note how all the echo commands have space in front of them. Since I have shopt -s ignorespace (for reasons unrelated to tmuxp), it means that I can't arrow-up to rerun those commands. Wrapping the commands like this: - "echo bla" does not help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions