我使用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帐户上运行吗?非常感谢!
键入alias
作为root user
列出root的所有可用别名。如果不存在,请确保alias subl
可用。
切换到root user
后,你的〜/ .bash_profile将无效。您可以使用source /Users/<your non-root username>/.bash_profile
来定义那里定义的别名。