Perhaps it would help if you actually told us why it’s a partial solution.
As far as I can remember, this is the first time the TERM variable has noticeably affected anything other than the terminal for me.
Anyway, probably best to go back to the devs and see if they can fix it for other values of TERM, especially if they used to work.
To be specific the selection prompt is failing immediately, due to the TERM variable. If you press q at the prompt then you get the same “failed:” error.
It’s only a partial solution because when launching custom applications from a drawer, the values set in .zshrc seem to be ignored and and the default ‘xterm-256color’ is used (see my edit further up the post). I’ve noticed in nnn that when TERM is set to ’ xterm-256color’ and ‘]’ is pressed there are unwanted characters in the prompt.
If I open a terminal from a launcher (eg menu entry), then it works as expected as the terminal sources the .zshrc (or .bashrc). Are you using bash in these terminals? If so you need to set it in .bashrc.
I’m using zsh with ‘export TERM=gnome-256color’ in .zshrc.
Try this:
Add to your drawer the ‘run command’, then open the run command and input ‘nnn -cdfgRUl1’. Then open a nnn terminal window ‘]’. Type ‘echo $TERM’. On my setup, I get ‘xterm-256color’, and unwanted characters after the prompt. It also fails when adding nnn as a custom application to the drawer, as described in the edit above. When mate-terminal is launched from the draw ‘echo $TERM’ returns ‘gnome-256color’.
Was the value returned ‘xterm-256color’?
Just tried your suggestion of creating an executable file named nnn, but when it was launched from the drawer, I got an empty terminal, the CPU cores went to 80% and the system became unresponsive!
It was without the script (when launched from the drawer, or “run command”). The script works for me, including when launched from the drawer, I get gnome-256color.
Please paste the contents of the script so we can check it (I assume you copied it correctly, but ). I take it you put it in ~/.local/bin?
I’m not at home and this laptop is kde, so I’m using another pc with mate for testing and it hasn’t been updated in a few weeks. I’m updating atm, to see if that will make a difference.
As expected, it still works fine even after a reboot.
That looks good. The shebang (#!/usr/bin/bash) has to be on the first line, is it? I think the script should work either way (it does here but this pc uses bash, I can test on zsh in a an hour or two).
What are the extra chars you get?
Just in case, what’s the command in the launcher?
Don’t use zsh for scripts, even if you use it as your shell. Bash is better for scripting and more portable than zsh.
The shebang line (#!) tells linux to run it using the proper shell.
Have you tried guake? It’s a drop down terminal, you can just press F12 (to drop down) and type nnn.
Shebang is at line 1, column 1. When using #!/usr/bin/bash, and launching from anywhere, I get repeated lines of “/usr/bin/bash: warning: shell level (1000) too high, resetting to 1” in the terminal. The installed nnn is in /usr/local/bin and the script is in ~/.local/bin. Could there be a conflict as to which has priority? The command in the launcher is ‘/usr/bin/mate-terminal -e /home/manjaro/.local/bin/nnn’. But just nnn in the mate-terminal also produces the CPU overload. The unwanted characters are ‘Enter’ to continue^[[I, so ^[[I has been added to the prompt.