mirror of
https://github.com/jarun/nnn.git
synced 2024-11-26 09:52:12 +03:00
Updated Troubleshooting (markdown)
parent
9587b77efe
commit
5f98797761
@ -34,13 +34,11 @@ n ()
|
|||||||
|
|
||||||
#### New window/pane using cwd
|
#### 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`
|
`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`:
|
A script example`tmux_split_curdir.sh`:
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
#!/bin/bash
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
cwd=
|
cwd=
|
||||||
cc=$(tmux display -p '#{pane_current_command}')
|
cc=$(tmux display -p '#{pane_current_command}')
|
||||||
if [ $cc == "nnn" ] ; then
|
if [ $cc == "nnn" ] ; then
|
||||||
@ -63,9 +62,9 @@ fi
|
|||||||
tmux split-window -c "$cwd"
|
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
|
## Broken control key
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user