Skip to content

Instantly share code, notes, and snippets.

@brianmaher84
Last active October 9, 2024 15:28
Show Gist options
  • Save brianmaher84/b42a5fde90ffba20cf8e7625ecb9a738 to your computer and use it in GitHub Desktop.
Save brianmaher84/b42a5fde90ffba20cf8e7625ecb9a738 to your computer and use it in GitHub Desktop.
Run Terminator terminal (or any WSL GUI) without leaving a windows shell open as parent process
So you want to launch a WSL GUI process but not leave a parent terminal that if closed killed your GUI application?
Step 1: Create a Powershell script file to launch your wsl application:
start-process powershell -ArgumentList "wsl.exe -- terminator" -WindowStyle hidden
Save it as something meaningful like terminator.ps1 in this example.
Step 2: Create a Windows shortcut to the Powershell script like below:
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -File "terminator.ps1"
A powershell window will appear briefly then close and launch your WSL GUI Application!
You can pin the shortcut to your start menu for easy launching!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment