tmux-python / tmux-python/tmuxp

environment option not work on PATH variable

Open
#489 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
4.6k
Forks
248
Avg merge
2h 13m
Merged PRs (30d)
1

Description

I am trying to load the PATH variable in a tmuxp session and this variable should be available in any new window of the session:

global_options:
default-command: /bin/bash 
environment:
  EDITOR: /usr/bin/vim
  PATH: ${PATH}$HOME/.config/myproj/
session_name: myproj
windows:
- window_name: main-dev
  focus: true
  layout: horizontal
  panes:
  - shell_command:
    - printf '\033]2;%s\033\\' 'Editor' 
    focus: true

${PATH}$HOME/.config/myproj/ it only loads in the current window but when a new window is created the variable disappears
while EDITOR is loaded in any new window and does not disappear

Step 2: Provide tmuxp details
  • Python 2.7.6
  • system PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/opt/bin:/usr/bin/core_perl:/usr/games/bin:/home/robot/.local/bin:/root/.gem/ruby/2.3.0/bin:/opt/android-sdk/tools:/opt/android-sdk/platform-tools:/opt/android-sdktools/:/opt/android-sdkplatform-tools/:
  • tmux 2.9a
  • tmuxp 1.5.1
  • tmux /usr/bin/tmux
  • tmuxp ~/.local/bin,
  • libtmux ?
  • shell bash
  • output of
    `myproj: 2 windows (created Tue May 14 01:26:02 2019) (attached)`,
     '0: main-dev* (1 panes) [210x50] [layout acde,210x50,0,0,1] @1 (active)`, 
    `0: [210x50] [history 42/2000, 30200 bytes] %1 (active)'
  • output of tmux show-options -g:
@plugin "tmux-plugins/tmux-sensible"
activity-action other
assume-paste-time 1
base-index 0
bell-action any
default-command "/bin/bash"
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 4000
history-limit 50000
key-table "root"
lock-after-time 0
lock-command "lock -np"
message-command-style fg=yellow,bg=black
message-style fg=black,bg=yellow
mouse off
prefix C-b
prefix2 None
renumber-windows off
repeat-time 500
set-titles off
set-titles-string "#S:#I:#W - \"#T\" #{session_alerts}"
silence-action other
status on
status-bg green
status-fg black
status-format[0] "#[align=left range=left #{status-left-style}]#{T;=/#{status-left-length}:status-left}#[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},}}]#{T:window-status-format}#[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},}}]#{T:window-status-current-format}#[norange list=on default]#{?window_end_flag,,#{window-status-separator}}}#[nolist align=right range=right #{status-right-style}]#{T;=/#{status-right-length}:status-right}#[norange default]"
status-format[1] "#[align=centre]#{P:#{?pane_active,#[reverse],}#{pane_index}[#{pane_width}x#{pane_height}]#[default] }"
status-interval 5
status-justify left
status-keys emacs
status-left "[#S] "
status-left-length 10
status-left-style default
status-position bottom
status-right "#{?window_bigger,[#{window_offset_x}#,#{window_offset_y}] ,}\"#{=21:pane_title}\" %H:%M %d-%b-%y"
status-right-length 40
status-right-style default
status-style fg=black,bg=green
update-environment[0] "PATH"
visual-activity off
visual-bell off
visual-silence off
word-separators " -_@"

, tmux show-window-options -g

aggressive-resize on
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
main-pane-height 24
main-pane-width 80
mode-keys vi
mode-style fg=black,bg=yellow
monitor-activity off
monitor-bell on
monitor-silence 0
other-pane-height 0
other-pane-width 0
pane-active-border-style fg=green
pane-base-index 0
pane-border-format "#{?pane_active,#[reverse],}#{pane_index}#[default] \"#{pane_title}\""
pane-border-status off
pane-border-style default
remain-on-exit off
synchronize-panes off
window-active-style default
window-size smallest
window-status-activity-style reverse
window-status-bell-style reverse
window-status-current-format "#I:#W#{?window_flags,#{window_flags}, }"
window-status-current-style default
window-status-format "#I:#W#{?window_flags,#{window_flags}, }"
window-status-last-style default
window-status-separator " "
window-status-style default
window-style default
wrap-search on
xterm-keys on
  • output of tmuxp freeze <SESSION_NAME>
session_name: myproj
windows:
- focus: 'true'
  layout: acde,210x50,0,0,1
  options:
    automatic-rename: 'off'
  panes:
  - focus: 'true'
    shell_command: bash
  start_directory: /home/robot
  window_name: main-dev
Step 3: Describe your environment
  • Architecture: x86_64 GNU/Linux
  • OS version: Arch Linux 5.0.11-arch1-1-ARCH
Step 4: Describe the problem:
Steps to reproduce:
  1. create dev.yam file
  2. tmuxp load dev.yaml
  3. in the current window: echo $PATH and echo $EDITOR
    the variable $HOME/.config/myproj/ appears
    $EDITOR show "vim"
    ctrl+b+c //new window
    in new windows: echo $PATH and echo $EDITOR
    the variable $HOME/.config/myproj/ does not appears
    $EDITOR show "vim"
Observed Results:
  • the $HOME/.config/myproj/ variable is not displayed in new windows
Expected Results:
  • that the $HOME/.config/myproj/ in PATH variable can be accessed from any created window, just like the variable EDITOR

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue with tmuxp load dev.yaml, compare echo $PATH and echo $EDITOR in the initial and newly created windows, and inspect the environment option handling. Use the provided tmux show-options -g output and tmuxp freeze <SESSION_NAME> command while investigating. Done means the configured PATH addition remains available in every new window, like EDITOR.

Written by the indexing model from the issue text.

Assessment

Tech stack
bash, python, yaml
Domain
cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.