mirror of
https://github.com/jarun/nnn.git
synced 2024-11-23 00:26:00 +03:00
Updated Troubleshooting (markdown)
parent
6bb47a8a19
commit
9587b77efe
@ -10,6 +10,8 @@ Use the following command to set default applications for mimetypes when using `
|
|||||||
|
|
||||||
## Tmux configuration
|
## Tmux configuration
|
||||||
|
|
||||||
|
#### Keyboard
|
||||||
|
|
||||||
`nnn` may not handle keypresses correctly when used with tmux (see issue #104 for more details). Set `TERM=xterm-256color` to address it.
|
`nnn` may not handle keypresses correctly when used with tmux (see issue #104 for more details). Set `TERM=xterm-256color` to address it.
|
||||||
|
|
||||||
By default tmux advertises 8-color support. To show icons in tmux add the following to tmux configuration file:
|
By default tmux advertises 8-color support. To show icons in tmux add the following to tmux configuration file:
|
||||||
@ -30,6 +32,41 @@ 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:
|
||||||
|
|
||||||
|
`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:
|
||||||
|
|
||||||
|
`lsof -c nnn | grep cwd`
|
||||||
|
|
||||||
|
To get the path on the last executed cwd command:
|
||||||
|
|
||||||
|
`lsof -w -c nnn | grep cwd | tail -n 1 | awk '{print $9}'`
|
||||||
|
|
||||||
|
A script example`tmux_split_curdir.sh`:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
#!/bin/bash
|
||||||
|
cwd=
|
||||||
|
cc=$(tmux display -p '#{pane_current_command}')
|
||||||
|
if [ $cc == "nnn" ] ; then
|
||||||
|
cwd=$(lsof -w -c nnn | grep cwd | tail -n 1 | awk '{print $9}')
|
||||||
|
else
|
||||||
|
cwd=$(tmux display -p '#{pane_current_path}')
|
||||||
|
fi
|
||||||
|
|
||||||
|
tmux split-window -c "$cwd"
|
||||||
|
```
|
||||||
|
|
||||||
|
Adding this script to your tmux path allows it to be run with `run-shell`:
|
||||||
|
|
||||||
|
`bind -n KEYS run-shell "tmux_split_curdir.sh"`
|
||||||
|
|
||||||
## Broken control key
|
## Broken control key
|
||||||
|
|
||||||
If a Ctrl-key combination is not working, check if it's masked due to terminal line settings:
|
If a Ctrl-key combination is not working, check if it's masked due to terminal line settings:
|
||||||
|
Loading…
Reference in New Issue
Block a user