如何使zsh在Mac OS X(在iTerm中)上作为登录Shell运行? [英] How to make zsh run as a login shell on Mac OS X (in iTerm)?

查看:89
本文介绍了如何使zsh在Mac OS X(在iTerm中)上作为登录Shell运行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Mac OS X上将zsh设置为登录shell时,由iTerm启动时,zsh不会将其作为登录shell运行,尽管它是以'-zsh'('-'作为arg [0]的第一个字符放置,这意味着它应该以登录外壳程序开头.

When zsh is set as a login shell on Mac OS X, when it is started by iTerm, zsh doesn't consider that it's being run as a login shell, although it's started as ‘-zsh’ (‘-’ is put as the first character of arg[0]) which is supposed to mean that it should start as a login shell.

因此,当我将登录shell设置为bash时,bash会识别$ 0中的第一个-"并作为登录shell运行,但zsh不会,尽管看起来应该如此.

So, when I set the login shell to bash, bash recognizes this first ‘-’ in $0 and runs as a login shell, but zsh doesn't, although it seems that it should.

是否有办法使zsh识别arg [0]中的-",或使iTerm使用--login命令行参数运行shell?

Is there a way to either make zsh recognize the ‘-’ in the arg[0], or make iTerm run the shell with a --login command line argument?

推荐答案

在iTerm中->首选项"->配置文件"选项卡->常规"部分,将命令设置为:/bin/zsh --login

In iTerm -> Preferences -> Profiles Tab -> General section set Command to: /bin/zsh --login

这篇关于如何使zsh在Mac OS X(在iTerm中)上作为登录Shell运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆