Fix Internet access by manually adding DNS address :
# add DNS in resolv.conf
sudo sed -i '1s/^/nameserver 1.1.1.1\n/' /etc/resolv.conf
# make the file immutable
sudo chattr +i /etc/resolv.conf
I have no clue how to solve that for now.
You can force a restart with wsl.exe --shutdown
.
- In Settings :
Build, Execution, Deployment -> Debugger -> Data Views -> Java
- Disable thoses options :
Enable alternative view for Collection classes
Enable 'toString()' object view
- In Settings :
Appearance & Behavior -> Menus ans Toolbars -> Navigation Bar Toolbar
- Add thoses actions (from the Other folder) :
Back
Forward
- Error :
java: You aren't using a compiler supported by lombok, so lombok will not work and has been disabled.
- Correction :
- In Setting :
Build, Execution, Deployment -> Compiler -> Shared build process VM options
- Add this parameter :
-Djps.track.ap.dependencies=false
- In Setting :
- In Settings :
Editor -> Code Style -> Java -> Imports
- Enable the option :
Use single class import
- Add 999 in thoses options :
Class count to use import with '*'
Names count to use static import with '*'
1.3 - Unable to bind port (Source)
A program can request a port that is somehow locked by Windows.
This bug appeared to me with Docker, but it is not related to Docker :
listen tcp :50051: bind: An attempt was made to access a socket in a way forbidden by its access permissions.
To solve this, you can check if you have the issue (in PowerShell) :
# the port should not be used
netstat -aon
# but you should see it in a port exclusion range
netsh int ipv4 show excludedportrange protocol=tcp
This is probably an error in the dynamic port configuration :
# check the "Start Port"
netsh int ipv[46] show dynamicport tcp
# if not set to "49152", change it with
netsh int ipv[46] set dynamic tcp start=49152 num=16384
Other solutions : https://youtrack.jetbrains.com/issue/IDEA-238995
2 - Oh-my-Posh
You can use choco (not in official documentation) :
choco install oh-my-posh
# test your install with
`oh-my-posh --print-shell`
Install a font globaly with :
right clic .ttf > "Install for all users"
Most themes use glyphs (icons) implemented in fonts from NerdFont project.
Recommended font (not official) : Literation Mono.
Add this parameter in settings.json
:
"profiles": {
"defaults": {
"fontFace": "LiterationMono NF"
}
}
Raspberry theme from Microsoft Doc :
Config
"schemes": [ { "name" : "Raspberry", "background" : "#3C0315", "black" : "#282A2E", "blue" : "#0170C5", "brightBlack" : "#676E7A", "brightBlue" : "#80c8ff", "brightCyan" : "#8ABEB7", "brightGreen" : "#B5D680", "brightPurple" : "#AC79BB", "brightRed" : "#BD6D85", "brightWhite" : "#FFFFFD", "brightYellow" : "#FFFD76", "cyan" : "#3F8D83", "foreground" : "#FFFFFD", "green" : "#76AB23", "purple" : "#7D498F", "red" : "#BD0940", "white" : "#FFFFFD", "yellow" : "#E0DE48" } ]
Change prompt (add line in $PROFILE
file) :
Invoke-Expression `
(oh-my-posh --init `
--shell pwsh `
--config "$env:LOCALAPPDATA\Programs\oh-my-posh\themes\agnoster.omp.json")
It's seems that you have to restart the PC for vanilla Powershell to work. On my rig, powershell complained that the oh-my-posh was not accessible. As a workaround, you can specify the absolute path of the command.
If you use the standard Powershell window, you will have some artifacts because the prompt need special icons that are not in the default font. As such, you must use a mono font.
- You can download this version of Literation Mono Nerd Font which has been specifically fixed to be recognised as monospace on Windows.
Choose the Literation Mono Nerd Font Complete Mono Windows Compatible ttf file from the zip. - then, modify the registry to add this to the list of fonts for terminal apps
$key = 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Console\TrueTypeFont'
Set-ItemProperty -Path $key -Name '000' -Value 'LiberationMono NF'
- Open PowerShell, right click the title bar > properties > Font > select your new font from the list.
install :
wget https://github.com/JanDeDobbeleer/oh-my-posh/releases/latest/download/posh-linux-amd64
chmod +x posh-linux-amd64
Change prompt (add line in ~/.bashrc
) :
eval "$(~/posh-linux-amd64 --init --shell bash --config /mnt/<LOCALAPPDATA>/Programs/oh-my-posh/themes/agnoster.omp.json)"
As well as Powershell terminal, you will need to change the font if you use the standrad WSL window. Follow the same rules as powershell part.
Change font (in Settings) :
"terminal.integrated.fontFamily": "LiterationMono NF"