在.bash_profile中设置后,mac不能按root使用快捷键

问题描述 投票:1回答:1

我使用MacOS,我在我的帐户上设置了应用程序的快捷键,但是当我想通过root帐户使用快捷键时,它不起作用,为什么?

我在.bash_profile中设置了Shortcut-key,如下所示:

alias subl="'/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl'"
alias pycharm="'/Applications/PyCharm.app/Contents/MacOS/pycharm'"

在我的帐户上,它的工作方式如下:

Shortcut-key work with my account

但是当我使用root帐户时,它不起作用,就像:

Shortcut-key doesn't work with root account

如何设置快捷键,它可以在我的帐户和root帐户上运行吗?非常感谢!

bash macos
1个回答
0
投票

键入alias作为root user列出root的所有可用别名。如果不存在,请确保alias subl可用。

切换到root user后,你的〜/ .bash_profile将无效。您可以使用source /Users/<your non-root username>/.bash_profile来定义那里定义的别名。

© www.soinside.com 2019 - 2024. All rights reserved.