【问题标题】:sublime text not opening from command line tmux崇高文本未从命令行 tmux 打开
【发布时间】:2015-10-10 08:37:06
【问题描述】:

我有 Sublime Text 作为别名,所以我可以从 MacOS 上的终端调用它。

自从我开始使用 tmux 以来,运行以下命令会打开 sublime,但不会在当前目录上。就像别名不接受 tmux 上的参数一样。

subl .

没有 tmux 这个命令可以正常工作。

tmux 别名参数有任何已知问题吗?

【问题讨论】:

  • 您找到解决此问题的方法了吗?我遇到了同样的问题?
  • @Alexander - 不是真的,我只是停止使用该命令,这是一种耻辱:/
  • 这里也一样,我只是停止使用该命令。

标签: macos tmux


【解决方案1】:

This answer from SuperUser 帮了我大忙。

brew install reattach-to-user-namespace

然后将以下内容附加到您的~/.tmux.conf

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

最后,获取 tmux 的配​​置文件

tmux source ~/.tmux.conf

我一直使用subl .!很遗憾你训练自己不要使用这个有用的命令。

【讨论】:

    【解决方案2】:

    我在重新安装 Homebrew 后遇到了同样的问题。不知道为什么会发生,但我能够解决它,但只需将以下行添加到我的 .bash_profile 的末尾。

    alias subl='open -a "/Applications/Sublime Text.app"'
    

    然后关闭并重新打开终端会话或运行source ~/.bash_profile 以重新加载配置文件。

    【讨论】:

    • 这可行,但会阻止您使用可以传递给 subl 二进制文件的任何常规参数。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-09-14
    • 2021-05-26
    • 2014-11-21
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多