From 5f98797761bec55d0d1e3580971ffb5308c2256c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pi=C3=B1a=20Colada?= Date: Wed, 5 May 2021 13:00:26 +0530 Subject: [PATCH] Updated Troubleshooting (markdown) --- Troubleshooting.md | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) 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