diff --git a/Troubleshooting.md b/Troubleshooting.md index ab72864..8ea70da 100644 --- a/Troubleshooting.md +++ b/Troubleshooting.md @@ -34,13 +34,11 @@ n () #### New window/pane using cwd -`nnn` does not change the process cwd while navigating. This may produce unexpected behaviour when using functions such as: +`nnn` does not set the terminal's cwd while navigating. So the following may not work: -`tmux new-window -c "#{pane_current_path}"` + tmux new-window -c "#{pane_current_path}" -*See [author comment](https://github.com/jarun/nnn/issues/332#issuecomment-533937941) and issue #565 for more details.* - -One possible workaround is to extract the path from the cwd command that nnn uses: +One possible workaround is to extract the path from the cwd command that `nnn` uses: `lsof -c nnn | grep cwd` @@ -50,8 +48,9 @@ To get the path on the last executed cwd command: A script example`tmux_split_curdir.sh`: -```bash -#!/bin/bash +```sh +#!/usr/bin/env sh + cwd= cc=$(tmux display -p '#{pane_current_command}') if [ $cc == "nnn" ] ; then @@ -63,9 +62,9 @@ fi tmux split-window -c "$cwd" ``` -Adding this script to your tmux path allows it to be run with `run-shell`: +Adding this script to your `tmux` path allows it to be run with `run-shell`: -`bind -n KEYS run-shell "tmux_split_curdir.sh"` + bind -n KEYS run-shell "tmux_split_curdir.sh" ## Broken control key