From 2f8f14d77df1b68f892731f4d212fe801cbbd6c8 Mon Sep 17 00:00:00 2001 From: Valerie Wolfe Date: Tue, 27 Aug 2024 09:05:25 -0400 Subject: [PATCH] scripts: added 'wsl.sh' --- README.md | 1 + scripts/justfile | 1 + scripts/wsl.sh | 7 +++++++ 3 files changed, 9 insertions(+) create mode 100755 scripts/wsl.sh diff --git a/README.md b/README.md index b233d59..e671610 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,7 @@ A feature-barren DOS clone of `ls` that hides Windows hidden files. Relies on - `elevate.sh`: Elevate WSL (`-l`) or Windows (`-w`) commands from WSL. - `explorer.sh`: Launch explorer from WSL. - `pwsh.sh`: Launch PowerShell Core. +- `wsl.sh`: A wrapper for `wsl.exe` that wraps in `hug` when piped. - `wt.sh`: Launch Windows Terminal. --- diff --git a/scripts/justfile b/scripts/justfile index b5dac21..bd1f6db 100644 --- a/scripts/justfile +++ b/scripts/justfile @@ -8,5 +8,6 @@ install DIR="/usr/local/bin": cp elevate.sh {{DIR}}/elevate cp explorer.sh {{DIR}}/explorer cp pwsh.sh {{DIR}}/pwsh + cp wsl.sh {{DIR}}/wsl cp wt.sh {{DIR}}/wt diff --git a/scripts/wsl.sh b/scripts/wsl.sh new file mode 100755 index 0000000..376162e --- /dev/null +++ b/scripts/wsl.sh @@ -0,0 +1,7 @@ +#!/usr/bin/bash + +if [[ ! -t 1 ]]; then + WRAPPER='hug' +fi +$WRAPPER '/mnt/c/Windows/System32/wsl.exe' $@ +