使Byobu在主目录中打开新屏幕

肖恩·哈根(Sean Hagen)

我不知道这是byobu的最新版本中是否有所更改,但是现在当我创建新屏幕时,新屏幕与当前窗口位于同一目录中。起初这并不太烦人,一个简单的“ cd〜”将使我到达想要的位置。但是我一直注意到奇怪的事情。在安装gem的过程中,如果我创建一个新窗口,则会进入安装该gem的目录(使用rbenv时)。

我只想停止。如何设置byobu / tmux,以便打开主目录中的所有新窗口?

我已经浏览了几个文件,但是似乎看不到任何会引起这种情况的命令(例如错误的“ chdir”)。

修理先生

在Ubuntu中,我可以通过将以下行添加到$ {HOME} /。byobu / .tmuxrc中来获得所需的行为:

set-option -g default-path $HOME

此选项是tmux手册页中的文档:

set-option [-agoqsuw] [-t target-session | target-window] option value
              (alias: set)
        Set a window option with -w (equivalent to the set-window-option
        command), a server option with -s, otherwise a session option.

        If -g is specified, the global session or window option is set.
        With -a, and if the option expects a string, value is appended
        to the existing setting.  The -u flag unsets an option, so a session
        inherits the option from the global options.  It is not possible to
        unset a global option.

        The -o flag prevents setting an option that is already set.

        The -q flag suppresses the informational message (as if the quiet
        server option was set).

        Available window options are listed under set-window-option.

        value depends on the option and may be a number, a string, or a flag
        (on, off, or omitted to toggle).

        Available server options are:

        <snip>

        default-path path

        Set the default working directory for new panes.  If empty (the
        default), the working directory is determined from the process running
        in the active pane, from the command line environment or from the
        working directory where the session was created.  Otherwise the same
        options are available as for the -c flag to new-window.

我最初尝试使用set-option -g default-path ~,但是tmux似乎不理解该别名。

更新:以上内容不适用于byobu 5.92(也许是其他版本)和tmux 1.9,因为tmux删除了该default-path选项。似乎byobu开发人员正在使用该行为来获得在CWD中打开新窗口的行为,而我和提问者希望它默认在HOME目录中打开。在新的默认绑定中,/usr/share/byobu/keybindings/f-keys.tmux我发现了这一点:

bind-key -n F2 new-window -c "#{pane_current_path}" \; rename-window "-"
bind-key -n C-F2 display-panes \; split-window -h -c "#{pane_current_path}"
bind-key -n S-F2 display-panes \; split-window -v -c "#{pane_current_path}"

要获得始终使byobu在主目录中打开新屏幕的预期行为,请将以下内容添加到~/.byobu/keybindings.tmux

bind-key -n F2 new-window -c "$HOME" \; rename-window "-"
bind-key -n C-F2 display-panes \; split-window -h -c "$HOME"
bind-key -n S-F2 display-panes \; split-window -v -c "$HOME"

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

File(也称为Nautilus)中的书签仅打开主目录

来自分类Dev

为什么在我的主目录以外的目录中打开终端模拟器?

来自分类Dev

Ember.js-在主目录而不是当前目录中嵌入新命令来安装项目

来自分类Dev

禁止在主目录中执行

来自分类Dev

列出主目录中的文件

来自分类Dev

如何在主目录中复制主目录?

来自分类Dev

主目录中的.gnupg目录是什么?

来自分类Dev

我的主目录中的神秘目录

来自分类Dev

我的主目录中的未知目录或文件

来自分类Dev

Byobu /屏幕不断冻结在腻子中

来自分类Dev

在C ++中打开一个新的终端屏幕

来自分类Dev

如何在Angela Caicedo的JavaFX管理多个屏幕框架中以新的JavaFx阶段打开新屏幕

来自分类Dev

主目录(?)

来自分类Dev

在我的主目录中安装PHP

来自分类Dev

ckeditor在browserify中:主目录错误

来自分类Dev

在OS X Mavericks中更改主目录

来自分类Dev

指向.deb包中的真实主目录

来自分类Dev

NSOperation访问在主目录中已取消

来自分类Dev

主目录中名为Typescript的奇怪文件

来自分类Dev

Shell别名在主目录中执行

来自分类Dev

主目录中名为Typescript的奇怪文件

来自分类Dev

主目录中的新贵PID文件?

来自分类Dev

更改主目录中的RStudio库路径

来自分类Dev

在OS X Mavericks中更改主目录

来自分类Dev

主目录中的可用空间有问题

来自分类Dev

Ubuntu 14中缺少主目录

来自分类Dev

asp.net中主目录的路径

来自分类Dev

在PowerShell中更改到主目录

来自分类Dev

什么是我的主目录中的.serverauth。#####文件?