* Atanas Vladimirov <vl...@bsdbg.net> [2019-11-26 14:27:33 +0200]:

Hello,

The following works on Linux:

```
bind c new-window -c "#{pane_current_path}"

```

but the `pane_current_path` variable does not exists on OpenBSD.
Does anyone now how can I achieve the same behavior on OpenBSD?

Hi Atanas,

I recently asked Nicolas Marriott the same question on Freenode/#tmux. The
pane_current_path functionality is disabled on OpenBSD because of
security reasons.

For that reason I added the following function to my ~/.profile.  However,
it does not enable splitting without sending current processes to
background:

tsplit() {
        if [ -z "$TMUX" ]; then
                echo "error: not in tmux session" >&2
                return 1
        fi
        if [ $# -gt 0 ]; then
                if [ "$1" = "v" ]; then
                        tmux split-pane -v -c "$PWD"
                elif [ "$1" = "h" ]; then
                        tmux split-pane -h -c "$PWD"
                elif [ "$1" = "w" ]; then
                        tmux new-window -c "$PWD"
                else
                        echo "error: split direction not understood" >&2
                        return 2
                fi
        else
                tmux split-pane -h -c $PWD
        fi
}

Best, Anders
--
Anders Damsgaard
https://adamsgaard.dk

Reply via email to