<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Wsl on stuartleeks.com</title>
    <link>https://stuartleeks.com/tags/wsl/</link>
    <description>Recent content in Wsl on stuartleeks.com</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Thu, 27 May 2021 13:42:16 +0100</lastBuildDate>
    <atom:link href="https://stuartleeks.com/tags/wsl/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Fun with WSL, GitHub CLI and Windows Notifications</title>
      <link>https://stuartleeks.com/posts/wsl-github-cli-windows-notifications-part-2/</link>
      <pubDate>Thu, 27 May 2021 13:42:16 +0100</pubDate>
      <guid>https://stuartleeks.com/posts/wsl-github-cli-windows-notifications-part-2/</guid>
      <description>&lt;h2 id=&#34;introduction&#34;&gt;Introduction&lt;/h2&gt;&#xA;&lt;p&gt;In the &lt;a href=&#34;https://stuartleeks.com/posts/wsl-github-cli-windows-notifications-part-1/&#34;&gt;last post&lt;/a&gt; we saw how to create a drop-in replacement for &lt;code&gt;notify-send&lt;/code&gt;. This allowed us to take a script that used &lt;code&gt;notify-send&lt;/code&gt; and run it without modification. In this post, we&amp;rsquo;ll take a look at how we can update that script to take better advantage of Windows notifications.&lt;/p&gt;&#xA;&lt;p&gt;At the end of that post, the notification was fairly generic as shown below:&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;./notification-previous.png&#34; alt=&#34;Notification with WSL Distro as category and &amp;ldquo;Run finished&amp;rdquo; as text&#34;&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Fun with WSL, GitHub CLI and Windows Notifications</title>
      <link>https://stuartleeks.com/posts/wsl-github-cli-windows-notifications-part-1/</link>
      <pubDate>Thu, 27 May 2021 07:10:16 +0100</pubDate>
      <guid>https://stuartleeks.com/posts/wsl-github-cli-windows-notifications-part-1/</guid>
      <description>&lt;h2 id=&#34;introduction&#34;&gt;Introduction&lt;/h2&gt;&#xA;&lt;p&gt;I&amp;rsquo;ve been making use of the &lt;a href=&#34;https://cli.github.com/&#34;&gt;GitHub CLI&lt;/a&gt; and finding it a productive way to work with GitHub. Recently, &lt;a href=&#34;https://blog.gripdev.xyz/&#34;&gt;Lawrence Gripper&lt;/a&gt; shared with me a handy alias that he had set up:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;alias ghrun&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;gh run list | grep \$(git branch --show-current) | cut -d&lt;/span&gt;$&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;\t&amp;#39; -f 8 | xargs gh run watch &amp;amp;&amp;amp; notify-send &amp;#39;Run finished&amp;#39;&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This &lt;code&gt;ghrun&lt;/code&gt; alias finds the latest GitHub actions workflow for the current branch and starts a &lt;code&gt;gh run watch&lt;/code&gt; for it. This shows the progress through the steps of a workflow:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Forwarding copy to clipboard from dev container to Windows Host</title>
      <link>https://stuartleeks.com/posts/vscode-devcontainer-clipboard-forwarding/</link>
      <pubDate>Wed, 17 Feb 2021 19:11:12 +0000</pubDate>
      <guid>https://stuartleeks.com/posts/vscode-devcontainer-clipboard-forwarding/</guid>
      <description>&lt;h2 id=&#34;background&#34;&gt;Background&lt;/h2&gt;&#xA;&lt;p&gt;I&amp;rsquo;ve mentioned &lt;a href=&#34;https://stuartleeks.com/posts/vscode-devcontainers/&#34;&gt;VS Code dev containers&lt;/a&gt; on this blog before and like &lt;a href=&#34;https://stuartleeks.com/posts/vscode-devcontainers-wsl/&#34;&gt;using them from WSL&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;I&amp;rsquo;m also a fan of &lt;a href=&#34;https://github.com/lawrencegripper/azbrowse&#34;&gt;azbrowse&lt;/a&gt; for working with Azure resources from the terminal, and lately have found myself running azbrowse from within a dev container for various reasons.&lt;/p&gt;&#xA;&lt;p&gt;There are several features in azbrowse that copy data to the clipboard, and when run from WSL it detects that and copies to the Windows clipboard, which is convenient. When run from a dev container, the experience isn&amp;rsquo;t so good (a polite way of saying that it doesn&amp;rsquo;t work).&lt;/p&gt;</description>
    </item>
    <item>
      <title>Set Windows Terminal to use your user HOME directory</title>
      <link>https://stuartleeks.com/posts/windows-terminal-start-directory/</link>
      <pubDate>Fri, 09 Oct 2020 12:31:17 +0000</pubDate>
      <guid>https://stuartleeks.com/posts/windows-terminal-start-directory/</guid>
      <description>&lt;blockquote&gt;&#xA;&lt;p&gt;Cross-posted from &lt;a href=&#34;https://wsl.tips/tips/windows-terminal-start-directory&#34;&gt;wsl.tips/tips/windows-terminal-start-directory&lt;/a&gt;&lt;/p&gt;&lt;/blockquote&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://aka.ms/terminal&#34;&gt;Windows Terminal&lt;/a&gt; is the new Terminal experience from the Windows team. It&amp;rsquo;s &lt;a href=&#34;https://github.com/microsoft/terminal&#34;&gt;open source&lt;/a&gt; and iterating quickly. As a WSL user, a really nice feature is that it auto-detects the WSL distros you have installed.&lt;/p&gt;&#xA;&lt;p&gt;By default, when you launch Windows Terminal for a WSL distro it puts you in the &lt;code&gt;/mnt/...&lt;/code&gt; path for your Windows user profile (e.g. &lt;code&gt;/mnt/c/Users/stuart&lt;/code&gt;).&lt;/p&gt;&#xA;&lt;p&gt;As &lt;a href=&#34;https://www.docker.com/blog/docker-desktop-wsl-2-best-practices/&#34;&gt;this post&lt;/a&gt; by &lt;a href=&#34;https://twitter.com/sferquel&#34;&gt;Simon Ferquel&lt;/a&gt; suggests: &amp;ldquo;Fully embrace WSL2&amp;rdquo;! In other words, use the file system in your WSL distro. When you embrace this mindset, having Windows Terminal put you in a mounted Windows path is less helpful - I like to have it default to my &lt;code&gt;HOME&lt;/code&gt; directory for the distro.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Forwarding SSH Agent requests from WSL to Windows</title>
      <link>https://stuartleeks.com/posts/wsl-ssh-key-forward-to-windows/</link>
      <pubDate>Fri, 03 Jul 2020 15:11:12 +0000</pubDate>
      <guid>https://stuartleeks.com/posts/wsl-ssh-key-forward-to-windows/</guid>
      <description>&lt;h2 id=&#34;background&#34;&gt;Background&lt;/h2&gt;&#xA;&lt;p&gt;As I mentioned in my &lt;a href=&#34;https://stuartleeks.com/posts/git-for-windows-ssh-key-passphrases/&#34;&gt;previous post&lt;/a&gt;, I switched to using SSH key auth for GitHub and Azure DevOps Repos a long time ago and found it a positive experience. At first I was a bit lazy and didn&amp;rsquo;t use passphrases on my keys, and just kept a copy of my keys in the &lt;code&gt;.ssh&lt;/code&gt; folder in my User folder in Windows and another copy in &lt;code&gt;~/.ssh&lt;/code&gt; in WSL.&lt;/p&gt;&#xA;&lt;p&gt;For day-to-day working this worked okay, but I finally got round to adding passphrases to my keys a while back and was less happy with the setup at that point. My previously suppressed niggles around having the keys in multiple places re-surfaced once I had to add handle passphrases in multiple systems on the same machine!&lt;/p&gt;</description>
    </item>
    <item>
      <title>Fixing Clock Skew with WSL 2</title>
      <link>https://stuartleeks.com/posts/fixing-clock-skew-with-wsl-2/</link>
      <pubDate>Thu, 23 Apr 2020 21:27:16 +0100</pubDate>
      <guid>https://stuartleeks.com/posts/fixing-clock-skew-with-wsl-2/</guid>
      <description>&lt;h2 id=&#34;background-to-the-problem&#34;&gt;Background to the problem&lt;/h2&gt;&#xA;&lt;p&gt;I&amp;rsquo;m quite a fan of the Windows Subsystem for Linux (WSL), especially WSL version 2 which addresses a bunch of feedback I had for WSL 1. (There&amp;rsquo;s even a link to a recording of a lightning talk I gave on WSL 2 on the &lt;a href=&#34;https://stuartleeks.com/about/writing-and-speaking#december-2019---net-oxford---wsl2&#34;&gt;speaking notes&lt;/a&gt; page).&lt;/p&gt;&#xA;&lt;p&gt;However, there&amp;rsquo;s one issue that continues to bite me: clock skew. With WSL 2 there&amp;rsquo;s a special VM that Linux runs in that has a bunch of magic sauce applied to make it meld into the Windows environment in ways that a standard VM simply can&amp;rsquo;t/doesn&amp;rsquo;t (can you tell that I&amp;rsquo;m not in the WSL engineering team from that description? 😉). My understanding of the issue is that the clock skew happens when the host machine sleeps/hibernates because the VM for the WSL Linux distro doesn&amp;rsquo;t have its clock updated when the host resumes.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Visual Studio Code and Dev containers in the Windows Subsystem for Linux (WSL)</title>
      <link>https://stuartleeks.com/posts/vscode-devcontainers-wsl/</link>
      <pubDate>Wed, 01 Apr 2020 19:18:23 +0100</pubDate>
      <guid>https://stuartleeks.com/posts/vscode-devcontainers-wsl/</guid>
      <description>&lt;blockquote&gt;&#xA;&lt;p&gt;UPDATE (2020-04-08): With the &lt;a href=&#34;https://code.visualstudio.com/updates/v1_44&#34;&gt;1.44 release&lt;/a&gt; of Visual Studio Code (and the corresponding &lt;a href=&#34;https://github.com/microsoft/vscode-docs/blob/master/remote-release-notes/v1_44.md&#34;&gt;Remote Containers release&lt;/a&gt;), the Insiders release is no longer needed as the . I have updated the post to reflect this (update made in vscode dev container on stable release 😁).&lt;/p&gt;&lt;/blockquote&gt;&#xA;&lt;h2 id=&#34;introduction&#34;&gt;Introduction&lt;/h2&gt;&#xA;&lt;p&gt;In my &lt;a href=&#34;https://stuartleeks.com/posts/vscode-devcontainers/&#34;&gt;previous post&lt;/a&gt; I gave some thoughts on using Visual Studio Code &lt;a href=&#34;https://code.visualstudio.com/docs/remote/containers&#34;&gt;dev containers&lt;/a&gt;. Until very recently your source code needed to be cloned in Windows in order to be able to build and run dev containers with Visual Studio Code. While this has still been a great experience overall, I have hit a few edge cases where being able to have my source code in Linux (under WSL) and then create a dev container from there would have been a big help.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
