windows:wsl
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
windows:wsl [2019-08-02 17:20] – disable audible bell in WSL gabriel | windows:wsl [2019-08-18 22:20] (current) – [Using ssh-agent with multiple shell sessions] link to GitLab gabriel | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== | + | ====== Windows Subsystem for Linux ====== |
- | Run the following in an administrative PowerShell: | + | To enable and [[https:// |
+ | [[https:// | ||
+ | following in an administrative PowerShell: | ||
< | < | ||
Line 7: | Line 9: | ||
</ | </ | ||
- | You will be prompted to reboot. | + | You will be prompted to reboot. |
+ | Microsoft Store. | ||
===== Disable audible bell on terminal ===== | ===== Disable audible bell on terminal ===== | ||
Line 17: | Line 20: | ||
set bell-style none | set bell-style none | ||
set bell-style visible | set bell-style visible | ||
+ | </ | ||
+ | |||
+ | ===== Using ssh-agent with multiple shell sessions ===== | ||
+ | |||
+ | //These scripts are now maintained [[https:// | ||
+ | |||
+ | WSL doesn' | ||
+ | interface required to run native Linux applications in the Windows kernel. | ||
+ | implementation is the fact that there is no good way start an ssh-agent session that is automatically shared | ||
+ | all shell sessions in the same manner as a native Linux desktop. | ||
+ | |||
+ | These hacks allow successive shells to attach to the ssh-agent socket started by your first session. | ||
+ | |||
+ | These commands should be inserted in '' | ||
+ | |||
+ | < | ||
+ | # start ssh-agent for WSL | ||
+ | SSHAGENTINFO=/ | ||
+ | if [ -f $SSHAGENTINFO ]; then | ||
+ | printf " | ||
+ | source $SSHAGENTINFO | ||
+ | else | ||
+ | (umask 0077 ; mkdir -p `dirname $SSHAGENTINFO`; | ||
+ | source $SSHAGENTINFO | ||
+ | fi | ||
+ | </ | ||
+ | |||
+ | To make sure that the session gets cleaned up, insert this in '' | ||
+ | |||
+ | < | ||
+ | # shut down our ssh-agent when we close the final shell | ||
+ | SHELLPIDS=$( pgrep bash ) | ||
+ | SHELLCOUNT=$( echo $SHELLPIDS | wc -w ) | ||
+ | if [[ $SHELLCOUNT -eq 1 ]]; then | ||
+ | ssh-agent -k && rm -f / | ||
+ | fi | ||
</ | </ |
windows/wsl.1564780804.txt.gz · Last modified: 2019-08-02 17:20 by gabriel