Introduction
Since I discovered Obsydian note application, I use it to make notes on whatever ideas or projects I am working on. Sometimes, it is something as simple as keeping track of the steps I did to configure something.
If I am honest, most times those notes stay there forever without me reading them again. However, I discovered early in my life, when a student, that if I write things down, I can remember them better. Actually, it seems that more than remember, I learn them to the core. And that is the reason I keep a notebook in each job I had since 10 years ago or more, as well as for personal projects, ideas, plans, todo lists…
I always think that it is a great think because I would be able to write some documentation for things I do. The reality is that I barely took the notes to that point, as once I have things working I usually move on to the next shiny thing I want to try. So I decided that I should start putting some things out there, feel shame for the lame documentation they are, and hopefully get better.
WSL and Console in Windows
As I have been playing with WSL in my Windows pc lately, to write some code, read and learn things from other repositories and trying to get back to use Vim, I installed some time ago a console emulator.
It runs for Windows and it allows you to use a lot of configurations, different terminals, etc. and it also allows you to connect with WSL command line, bash in this case. It is Cmder. A tool I saw Jonathan Blow using in some video, I gave it a try. And it is awesome! I truly recommend if you, as many others, hate the limits of cmd in Windows.
So I had some notes because my plan was to share it here as well designed tutorial to configure it. It never happened, so I decided to put the notes here, as I had some problems at the beginning, and maybe it helps someone, or maybe it makes me take the documentation idea seriously. In any case, this is ugly, crude, incomplete and not very clear. But here it is anyway.
Notes
Problem when creating new task in Cmder: cannot start backend of WSL. Apparently, the problem is related to WSL 1 and this should use WSL2. In any case, the settings look like this:
set "PATH=%ConEmuBaseDirShort%\wsl;%PATH%" & %ConEmuBaseDirShort%\conemu-cyg-64.exe --wsl -cur_console:pm:/mnt
However, that is not the way it works. So I tried to fix it using directly wsl.exe and the config would look like this:
set "PATH=%ConEmuBaseDirShort%\wsl;%PATH%" & wsl.exe -d ubuntu -cur_console:pm:/mnt
This is not working either. Now it complains about not finding the user. That is because by default it takes Windows user name and, in WSL, I have a different name for the user. I tried a lot of changes here with no avail.
There are a lot of gaps in my understanding on how these things work, so I am in unknown territory here. (This is still the case, although I learnt a bit more how WSL is running).
I used a hack that I found in one forum answering problems with this, and the trick is to use the bash configuration and just change the command to wsl.exe. It works. But it is an ugly way of doing it in my opinion.
In the process of doing this hack I broke the bash config and that didn’t work. But I fixed it.
The problem is that as default, the configuration for WSL is using cygwin, as as far as I can tell, that is related to WSL1 version. WSL2 is the default now and it doesn’t need what is called WSL bridge, which seems to me the origin of the problem.
A lot of different configs and tries later, confusing as they may be I arrived to this set PATH="%ConEmuBaseDirShort%\wsl";%PATH% & wsl -d ubuntu
That works perfect. It is simple, but just the extra wrong configurations I read about and saw in forums etc was confusing me. Now it is golden.
Other references
Compare with this solution that is weird but I could try https://medium.com/@d.grigoriou/the-ninja-console-you-deserve-how-to-install-cmder-wsl-and-zsh-in-windows-10-66eefbb22587
Change default icons
You can change the icon that is shown in the task bar, in my case I wanted to use a nice icon with some colors, or even Ubuntu one. I forgot about that, and only got the standard icon for the main app. However the icon I managed to get in contextual menus is nice. So maybe I will give it a try again.
There are problems as sometimes it doesn’t get it properly. The folder where it is is D:\Cmder\cmder\icons
Personal Note
I didn’t write in a while. There is a reason to that. I am changing jobs and last months were a bit crazy. I also want to do too many projects and learn too many things at once. I need to focus, organize and get to it. So maybe it will take me awhile to start writing regularly, but I think it will be interesting because I will have many interesting things to talk about. That is one benefit of having a job that I really enjoy, and I think that will be the case.