Configure tmux to use zsh

69

Solution 1

You need to set default-command:

set -g default-command /usr/local/bin/zsh

default-shell variable only use to create a login shell, when default-command is empty - which is default value.

Or you can simply change your default shell to zsh, in this case, tmux will start a login shell, instead of non-login shell.

Solution 2

On top of what @cuonglm said, check for references to bash in your .tmux.conf.

For example, I was using a typical integration for copying & pasting in iTerm on Mac:

set-option -g default-command "reattach-to-user-namespace -l bash"

... which, to function properly with zsh had to be changed to:

set-option -g default-command "reattach-to-user-namespace -l zsh"

Share:
69

Related videos on Youtube

narfie
Author by

narfie

Updated on September 18, 2022

Comments

  • narfie
    narfie over 1 year

    I have in my .htaccess file the following code:

    RewriteRule ^(en|af|fr)/(.*)$ - [co=lang:$1:mysite.info:7200:/] #drop/update cookie with lang
    RewriteRule ^(en|af|fr)$ - [co=lang:$1:mysite.info:7200:/] #drop/update cookie with lang
    RewriteRule ^(en|af|fr)$    / [R,NC]
    RewriteRule ^(en|af|fr)/(.*)$ /$2 [R,NC]
    

    In my php I have this for selecting the language:

    <?php echo $_COOKIE['lang']; ?>
    <ul>
        <li><a href="/en<? echo $_SERVER['REQUEST_URI'];?>">en-ZA</a></li>
        <li><a href="/fr<? echo $_SERVER['REQUEST_URI'];?>">fr-MU</a></li>
        <li><a href="/af<? echo $_SERVER['REQUEST_URI'];?>">af-ZA</a></li>
    </ul>
    

    It semi-works, but it's not consistent. While I'm switching between languages it simply stops working, and then starts again if I keep clicking on the different languages.

    SECOND PART of question:

    How to reduce these lines:

    RewriteCond %{http_host} ^www.mysite.info [nc] #if url starts with www.mysite.info
    RewriteRule ^(.*)$ http://mysite.info/$1 [r,nc] #rewrite without the www
    
    RewriteCond %{http_host} ^www.(.*).mysite.info [nc] #if url starts with www.(aff).mysite.info
    RewriteRule ^(.*)$ http://%1.mysite.info/$1 [r,nc] #rewrite without the www
    
    RewriteCond %{HTTP_HOST} !^www\.  [NC]
    RewriteCond %{http_host} ^(.*)\.mysite.info [nc] #if subdomain is aff
    RewriteRule ^(.*)$ - [co=aff:%1:mysite.info:7200:/] #drop/update cookie with aff
    
    RewriteCond %{HTTP_HOST} !^www\.  [NC]
    RewriteCond %{http_host} ^(.*)\.mysite.info [nc] #if subdomain is aff
    RewriteRule ^(.*)$ http://mysite.info/$1 [nc,R] #rewrite without subdomain
    

    Appreciate the help, anubhava!

    • Admin
      Admin almost 9 years
      According to 2) tmux is using Zsh as your shell. What is your issue?
    • Admin
      Admin almost 9 years
      Sorry, I should have included that executing ps -p $$ in tmux prints: 20201 ttys001 0:00.02 -bash. Even though the $SHELL variable seems to be set, tmux doesn't actually seem to be using zsh. Also, on this machine powerline's only been configured for bash. Every time I start tmux, powerline's definitely visible.
  • narfie
    narfie over 10 years
    Thanx. It still isn't consistently working. But in the meantime I've read somewhere that for SEO it's better not to handle language settings with cookies, and to actually create subfolders for the different languages, so I'm going to use a different approach. I'm still marking yours as the answer, because you helped me to reduce my code from 4 lines to one.
  • narfie
    narfie over 10 years
    I've got another piece in my .htaccess file that might also need reducing, and would appreciate if you could take a look at it for me... if you're interested/willing?
  • anubhava
    anubhava over 10 years
    Yes sure I can help reduce that. Let me know what is your question.
  • cuonglm
    cuonglm almost 9 years
    @JustianMeyer: Can you show me your .tmux.conf?
  • MOHRE
    MOHRE almost 7 years
    @JustianMeyer Did you restart tmux with killall tmux; tmux command?