nb
nb copied to clipboard
WSL2 browse with w3m edit with code
I find nb very useful. I run it in WSL2, Ubuntu. Everything seems to work as it should except the browse mode with edit. I use w3m and code is set as the editor in nb. When I enter the edit mode with E and then in the edit area [] hit Enter, nb is briefly switching to the shell while a temporary file is opened in VS Code. Unfortunately the file is marked as deleted (indeicated by a strikethrough font) so editing in VS Code doesn't have any effect. NB is not waiting for the file to be close in VS Code. It returns back to the edit page in NB.
When I change the nb editor to vim it works as it should. When I run w3m directly with the environment variable EDITOR=code w3m in edit mode switched to VS Code without any issue.
Is this a bug in NB or am I doing sth wrong?
Glad you like it! To get w3m
working with VS Code, set the editor command in w3m
to code --wait
in the w3m
Options Setting Panel (open by typing o
). Let me know if this resolves it for you.
Yes, it did solve the problem. Thank you :)
Sorry, but maybe this one you may answer also. While using w3m is there a way to select the text for copying? Also bookmarks they do not open when you use nb open command. One solution for WSL would be to open them in the default browser in Windows og just use w3m. Is it possible to configure?
PS. For opening a url in a windows default browser there is wslview command which can be installed with https://github.com/wslutilities/wslu
PS. For opening a url in a windows default browser there is wslview command which can be installed with https://github.com/wslutilities/wslu
How do you deal with the fact that wslview returns immediately, and therefore nb browse
localhost server does not stay open long enough for the windows browser to load the cached files? Or perhaps I have wslview set-up the wrong way.
I'm using export BROWSER=wslview
Couldn't find anything in the readme so assumed this is the way. wslview works in that Firefox open on windows at the right url, but nothing loads because (presumably) nb
has already returned to prompt and closed the web server.