Open thamaraiselvam opened 4 years ago
Myself and @jpninanjohn debugged this issue. Our finding:
1) Problem is for any env having -t
in key or value
2) This bug is present in libtmux library itself.
We are calling self.session.set_environment(option, value)
at here which should properly set the env for the session. This internally calls session.cmd
which has this snippet.
def cmd(self, *args, **kwargs):
# if -t is not set in any arg yet
if not any('-t' in text_type(x) for x in args):
# insert -t immediately after 1st arg, as per tmux format
new_args = [args[0]]
new_args += ['-t', self.id]
new_args += args[1:]
args = new_args
return self.server.cmd(*args, **kwargs)
This adds a key and value as -t
and session id
if it does not find -t
in given args. This does not do an exact match. It matches -t
even if it is contained in middle of the word also in which case no target session is added. Hence the arguments are set for current session instead of new session.
Problem
Environment variable is not being set in a weird case
tmuxp details
/Users/thamaraiselvam/Documents/repositories/github.com/tmuxp/.venv/bin:/Users/thamaraiselvam/.rvm/gems/ruby-2.6.3/bin:/Users/thamaraiselvam/.rvm/gems/ruby-2.6.3@global/bin:/Users/thamaraiselvam/.rvm/rubies/ruby-2.6.3/bin:/usr/local/opt/helm@2/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Users/thamaraiselvam/.rvm/gems/ruby-2.6.3/bin:/Users/thamaraiselvam/.rvm/gems/ruby-2.6.3@global/bin:/Users/thamaraiselvam/.rvm/rubies/ruby-2.6.3/bin:/usr/local/opt/helm@2/bin:/Users/thamaraiselvam/.rvm/bin:/Users/thamaraiselvam/development/flutter/bin:/usr/local/Cellar/node/12.10.0/bin/:/Users/thamaraiselvam/go/bin:/usr/local/opt/go/libexec/binP:/usr/local/opt/fzf/bin:/Users/thamaraiselvam/.rvm/bin:/Users/thamaraiselvam/development/flutter/bin:/usr/local/bin:/usr/local/Cellar/node/12.10.0/bin/:/Users/thamaraiselvam/go/bin:/usr/local/opt/go/libexec/binP
output of tmux show-options -g
Environment
Darwin 19.2.0 Darwin Kernel Version 19.2.0: Sat Nov 9 03:47:04 PST 2019; root:xnu-6153.61.1~20/RELEASE_X86_64 x86_64
Step 4: Describe the problem:
tmuxp is not setting environment variable which starts with
-th
Steps to reproduce:
create a session yaml file as following
tmuxp load session.yaml
check following environments
only
ONE
will be thereObserved Results:
--log_level
Expected Results: