在Screen的启动时无法将Zsh作为登录shell

时间:2021-07-20 10:40:39

I put the following to my .zshrc

我把以下内容放到我的.zshrc中

if [[ $STY = '' ]] then screen -xR; fi

I get Bash when I start terminal now, although I have /bin/zsh at Terminal > Settings in Mac.

我现在开始终端时得到Bash,虽然我在Mac上的终端>设置中有/ bin / zsh。

Which variable do I need to change to make Zsh my login shell in Screen?

我需要更改哪个变量才能在屏幕中使Zsh成为我的登录shell?

4 个解决方案

#1


A fast way to change your shell, for example to Zsh, is to run the following code

更改shell的快速​​方法(例如更改为Zsh)是运行以下代码

chsh -s /bin/zsh

#2


  • Open your System Preferences.
  • 打开系统偏好设置。

  • Click on Accounts.
  • 单击“帐户”。

  • Click on the lock icon that says "Click the lock to make changes".
  • 单击“单击锁定以进行更改”的锁定图标。

  • Control-click or right click on your account name in the list of accounts on the left.
  • 按住Ctrl键单击或右键单击左侧帐户列表中的帐户名称。

  • Choose the Advanced Options... menu item.
  • 选择“高级选项...”菜单项。

  • Change your login shell to /bin/zsh.
  • 将您的登录shell更改为/ bin / zsh。

  • Close and reopen any shells in Terminal.app.
  • 关闭并重新打开Terminal.app中的任何shell。

#3


If environment and other things aren't working, then you can simply give it as an argument to screen: screen -xR zsh and screen will run zsh instead of something else (bash).

如果环境和其他东西不起作用,那么你可以简单地将它作为屏幕的参数:screen -xR zsh和screen将运行zsh而不是其他东西(bash)。

#4


SHELL=/bin/zsh screen

should work, i. e. set the environment variabe $SHELL

应该工作,我即设置环境变量$ SHELL

#1


A fast way to change your shell, for example to Zsh, is to run the following code

更改shell的快速​​方法(例如更改为Zsh)是运行以下代码

chsh -s /bin/zsh

#2


  • Open your System Preferences.
  • 打开系统偏好设置。

  • Click on Accounts.
  • 单击“帐户”。

  • Click on the lock icon that says "Click the lock to make changes".
  • 单击“单击锁定以进行更改”的锁定图标。

  • Control-click or right click on your account name in the list of accounts on the left.
  • 按住Ctrl键单击或右键单击左侧帐户列表中的帐户名称。

  • Choose the Advanced Options... menu item.
  • 选择“高级选项...”菜单项。

  • Change your login shell to /bin/zsh.
  • 将您的登录shell更改为/ bin / zsh。

  • Close and reopen any shells in Terminal.app.
  • 关闭并重新打开Terminal.app中的任何shell。

#3


If environment and other things aren't working, then you can simply give it as an argument to screen: screen -xR zsh and screen will run zsh instead of something else (bash).

如果环境和其他东西不起作用,那么你可以简单地将它作为屏幕的参数:screen -xR zsh和screen将运行zsh而不是其他东西(bash)。

#4


SHELL=/bin/zsh screen

should work, i. e. set the environment variabe $SHELL

应该工作,我即设置环境变量$ SHELL