Closed denik1981 closed 3 years ago
What is your $VISUAL
? Are you using detached edits?
I am able to use mousepad. So no issues with GUI programs in general. Can you try with a regular GUI editor?
Also, do you have plugins installed?
I can replicate. Seems like code
is the problem.
nnn
waits for the $EDITOR
to finish running and then returning execution to nnn
.
But: when you spawn code
it practically uses some IPC to another instance of code
and then it closes. Also for w/e reason code
spawns as a child of init
rather than w/e process spawned it, I wont delve deeper into this.
@jarun ..
export VISUAL=/usr/bin/code export EDITOR=/usr/bin/vim export NNN_TRASH=1 alias nnn='nnn -de'
Those are my current settings. But thanks anyway because I guess I solved the issue by adding the "E" flag, instructing nnn to use vim (EDITOR) for undettached edits. Maybe the documentation can make a tiny notice about this. It is not a rare case to use nnn in conjunction with VSCODE and batch renaming is such a powerful feature.
EDITOR="code -w"
seems to work.
-w --wait Wait for the files to be closed before
returning.
EDITOR="code -w"
seems to work.
Also beware of the potential issues with setting EDITOR="code -w"
it probably more portable to introduce your own script code-blocking
:
#!/usr/bin/env sh
code -w "$@"
and use EDITOR=code-blocking
I am closing this.
Sorry, we can't document vscode-specific behaviour. But I'll add a generic note that the instance of the editor must wait for the editing to complete.
Environment details (Put
x
in the checkbox along with the information)nnn
masterExact steps to reproduce the issue
The problem is that despite the renamer is aware of VSCODE being the prefered EDITOR, it sends and EMPTY file (wihouth the files being selected) on a temp directory named with the .nnn prefix plus a 6 letter hash (eg .nnnYHjhyZ).
I checked that the command runs without any issue when using the default nnn editor. I'm not sure if this is related to VSCODE or to any GUI editor.