Prevent directory variable expansion

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












tmux seems to override my default bash behavior. Suppose export someDir=/path/to/it, then in my shell



  1. Hitting tab on cd $someDir automatically adds a front slash, cd $someDir/. On tmux it does nothing, and prints $someDir (literally).

  2. Hitting tab on cd $someDir/ lists the contents. On tmux it expands the variable. Only two more tabs show the contents.

I have double checked both are running Bash, and if pertinent, this is my config:



set -g status-style bg=black
set -g status-style fg=red
set-window-option -g xterm-keys on
set -g terminal-overrides 'xterm*:smcup@:rmcup@'


How can I reproduce the original behavior?



More info



@Kusalananda's comment made me think that tmux might be overriding my completion settings. Hitting complete in a normal shell lists just 2 git wrappers. tmux shows a ton.










share|improve this question























  • Are you sure that you are running the bash shell both in and outside tmux?
    – Kusalananda
    Sep 11 at 7:12











  • @Kusalananda Good question - checked and yes.
    – kabanus
    Sep 11 at 7:13














up vote
0
down vote

favorite












tmux seems to override my default bash behavior. Suppose export someDir=/path/to/it, then in my shell



  1. Hitting tab on cd $someDir automatically adds a front slash, cd $someDir/. On tmux it does nothing, and prints $someDir (literally).

  2. Hitting tab on cd $someDir/ lists the contents. On tmux it expands the variable. Only two more tabs show the contents.

I have double checked both are running Bash, and if pertinent, this is my config:



set -g status-style bg=black
set -g status-style fg=red
set-window-option -g xterm-keys on
set -g terminal-overrides 'xterm*:smcup@:rmcup@'


How can I reproduce the original behavior?



More info



@Kusalananda's comment made me think that tmux might be overriding my completion settings. Hitting complete in a normal shell lists just 2 git wrappers. tmux shows a ton.










share|improve this question























  • Are you sure that you are running the bash shell both in and outside tmux?
    – Kusalananda
    Sep 11 at 7:12











  • @Kusalananda Good question - checked and yes.
    – kabanus
    Sep 11 at 7:13












up vote
0
down vote

favorite









up vote
0
down vote

favorite











tmux seems to override my default bash behavior. Suppose export someDir=/path/to/it, then in my shell



  1. Hitting tab on cd $someDir automatically adds a front slash, cd $someDir/. On tmux it does nothing, and prints $someDir (literally).

  2. Hitting tab on cd $someDir/ lists the contents. On tmux it expands the variable. Only two more tabs show the contents.

I have double checked both are running Bash, and if pertinent, this is my config:



set -g status-style bg=black
set -g status-style fg=red
set-window-option -g xterm-keys on
set -g terminal-overrides 'xterm*:smcup@:rmcup@'


How can I reproduce the original behavior?



More info



@Kusalananda's comment made me think that tmux might be overriding my completion settings. Hitting complete in a normal shell lists just 2 git wrappers. tmux shows a ton.










share|improve this question















tmux seems to override my default bash behavior. Suppose export someDir=/path/to/it, then in my shell



  1. Hitting tab on cd $someDir automatically adds a front slash, cd $someDir/. On tmux it does nothing, and prints $someDir (literally).

  2. Hitting tab on cd $someDir/ lists the contents. On tmux it expands the variable. Only two more tabs show the contents.

I have double checked both are running Bash, and if pertinent, this is my config:



set -g status-style bg=black
set -g status-style fg=red
set-window-option -g xterm-keys on
set -g terminal-overrides 'xterm*:smcup@:rmcup@'


How can I reproduce the original behavior?



More info



@Kusalananda's comment made me think that tmux might be overriding my completion settings. Hitting complete in a normal shell lists just 2 git wrappers. tmux shows a ton.







bash tmux






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Sep 11 at 7:25

























asked Sep 11 at 7:10









kabanus

1406




1406











  • Are you sure that you are running the bash shell both in and outside tmux?
    – Kusalananda
    Sep 11 at 7:12











  • @Kusalananda Good question - checked and yes.
    – kabanus
    Sep 11 at 7:13
















  • Are you sure that you are running the bash shell both in and outside tmux?
    – Kusalananda
    Sep 11 at 7:12











  • @Kusalananda Good question - checked and yes.
    – kabanus
    Sep 11 at 7:13















Are you sure that you are running the bash shell both in and outside tmux?
– Kusalananda
Sep 11 at 7:12





Are you sure that you are running the bash shell both in and outside tmux?
– Kusalananda
Sep 11 at 7:12













@Kusalananda Good question - checked and yes.
– kabanus
Sep 11 at 7:13




@Kusalananda Good question - checked and yes.
– kabanus
Sep 11 at 7:13










1 Answer
1






active

oldest

votes

















up vote
1
down vote



accepted










I'm not using tmux, but what I found (with horror) is that it's re-enabling the "programmable completion" of bash that I had long commented out in /etc/bash.bashrc -- thence the puzzling behavior you observed.



That's because tmux is exec'ing bash as a login shell (with argv[0] set to -bash) which is causing it to source /etc/profile and then /etc/profile.d/bash_completion.sh.



You have too options:



a) make the completion behavior the one you like in both login and non-login shells by editing .bash_profile and .bashrc



b) convince tmux not to run a login shell, eg. by



set -g default-command "/bin/bash"


in .tmux.conf






share|improve this answer






















  • That is CRAZY. Are there any repercussions you are aware of? I found this, which seems to be no: superuser.com/questions/968942/…
    – kabanus
    Sep 11 at 13:55










  • LOL. I'm using gnu screen, which does NOT start login shells by default. Neither does the terminal emulator (mlterm). Maybe I should check my head ;-)
    – mosvy
    Sep 11 at 14:01










Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f468184%2fprevent-directory-variable-expansion%23new-answer', 'question_page');

);

Post as a guest






























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
1
down vote



accepted










I'm not using tmux, but what I found (with horror) is that it's re-enabling the "programmable completion" of bash that I had long commented out in /etc/bash.bashrc -- thence the puzzling behavior you observed.



That's because tmux is exec'ing bash as a login shell (with argv[0] set to -bash) which is causing it to source /etc/profile and then /etc/profile.d/bash_completion.sh.



You have too options:



a) make the completion behavior the one you like in both login and non-login shells by editing .bash_profile and .bashrc



b) convince tmux not to run a login shell, eg. by



set -g default-command "/bin/bash"


in .tmux.conf






share|improve this answer






















  • That is CRAZY. Are there any repercussions you are aware of? I found this, which seems to be no: superuser.com/questions/968942/…
    – kabanus
    Sep 11 at 13:55










  • LOL. I'm using gnu screen, which does NOT start login shells by default. Neither does the terminal emulator (mlterm). Maybe I should check my head ;-)
    – mosvy
    Sep 11 at 14:01














up vote
1
down vote



accepted










I'm not using tmux, but what I found (with horror) is that it's re-enabling the "programmable completion" of bash that I had long commented out in /etc/bash.bashrc -- thence the puzzling behavior you observed.



That's because tmux is exec'ing bash as a login shell (with argv[0] set to -bash) which is causing it to source /etc/profile and then /etc/profile.d/bash_completion.sh.



You have too options:



a) make the completion behavior the one you like in both login and non-login shells by editing .bash_profile and .bashrc



b) convince tmux not to run a login shell, eg. by



set -g default-command "/bin/bash"


in .tmux.conf






share|improve this answer






















  • That is CRAZY. Are there any repercussions you are aware of? I found this, which seems to be no: superuser.com/questions/968942/…
    – kabanus
    Sep 11 at 13:55










  • LOL. I'm using gnu screen, which does NOT start login shells by default. Neither does the terminal emulator (mlterm). Maybe I should check my head ;-)
    – mosvy
    Sep 11 at 14:01












up vote
1
down vote



accepted







up vote
1
down vote



accepted






I'm not using tmux, but what I found (with horror) is that it's re-enabling the "programmable completion" of bash that I had long commented out in /etc/bash.bashrc -- thence the puzzling behavior you observed.



That's because tmux is exec'ing bash as a login shell (with argv[0] set to -bash) which is causing it to source /etc/profile and then /etc/profile.d/bash_completion.sh.



You have too options:



a) make the completion behavior the one you like in both login and non-login shells by editing .bash_profile and .bashrc



b) convince tmux not to run a login shell, eg. by



set -g default-command "/bin/bash"


in .tmux.conf






share|improve this answer














I'm not using tmux, but what I found (with horror) is that it's re-enabling the "programmable completion" of bash that I had long commented out in /etc/bash.bashrc -- thence the puzzling behavior you observed.



That's because tmux is exec'ing bash as a login shell (with argv[0] set to -bash) which is causing it to source /etc/profile and then /etc/profile.d/bash_completion.sh.



You have too options:



a) make the completion behavior the one you like in both login and non-login shells by editing .bash_profile and .bashrc



b) convince tmux not to run a login shell, eg. by



set -g default-command "/bin/bash"


in .tmux.conf







share|improve this answer














share|improve this answer



share|improve this answer








edited Sep 11 at 9:39

























answered Sep 11 at 9:17









mosvy

1,54719




1,54719











  • That is CRAZY. Are there any repercussions you are aware of? I found this, which seems to be no: superuser.com/questions/968942/…
    – kabanus
    Sep 11 at 13:55










  • LOL. I'm using gnu screen, which does NOT start login shells by default. Neither does the terminal emulator (mlterm). Maybe I should check my head ;-)
    – mosvy
    Sep 11 at 14:01
















  • That is CRAZY. Are there any repercussions you are aware of? I found this, which seems to be no: superuser.com/questions/968942/…
    – kabanus
    Sep 11 at 13:55










  • LOL. I'm using gnu screen, which does NOT start login shells by default. Neither does the terminal emulator (mlterm). Maybe I should check my head ;-)
    – mosvy
    Sep 11 at 14:01















That is CRAZY. Are there any repercussions you are aware of? I found this, which seems to be no: superuser.com/questions/968942/…
– kabanus
Sep 11 at 13:55




That is CRAZY. Are there any repercussions you are aware of? I found this, which seems to be no: superuser.com/questions/968942/…
– kabanus
Sep 11 at 13:55












LOL. I'm using gnu screen, which does NOT start login shells by default. Neither does the terminal emulator (mlterm). Maybe I should check my head ;-)
– mosvy
Sep 11 at 14:01




LOL. I'm using gnu screen, which does NOT start login shells by default. Neither does the terminal emulator (mlterm). Maybe I should check my head ;-)
– mosvy
Sep 11 at 14:01

















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f468184%2fprevent-directory-variable-expansion%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

How to check contact read email or not when send email to Individual?

Displaying single band from multi-band raster using QGIS

How many registers does an x86_64 CPU actually have?