1
0
mirror of https://github.com/mintty/wsltty.git synced 2025-02-07 05:31:04 +00:00

fix EOL, restore misdeleted chunk on original L138-141, tabs to spaces

This commit is contained in:
Cem Aksoylar 2018-06-10 12:15:21 -07:00
parent 52b03a43d9
commit 017b05c48c

View File

@ -117,43 +117,46 @@ do
distro=`regtool get "$lxss/$guid/DistributionName"` distro=`regtool get "$lxss/$guid/DistributionName"`
case "$distro" in case "$distro" in
Legacy) Legacy)
name="Bash on Windows" name="Bash on Windows"
launch= launch=
launcher="$SYSTEMROOT/System32/bash.exe" launcher="$SYSTEMROOT/System32/bash.exe"
;; ;;
*) name="$distro" *) name="$distro"
launch="$distro" launch="$distro"
launcher="$LOCALAPPDATA/Microsoft/WindowsApps/$distro.exe" launcher="$LOCALAPPDATA/Microsoft/WindowsApps/$distro.exe"
;; ;;
esac esac
basepath=`regtool get "$lxss/$guid/BasePath"` basepath=`regtool get "$lxss/$guid/BasePath"`
if package=`regtool -q get "$lxss/$guid/PackageFamilyName"` if package=`regtool -q get "$lxss/$guid/PackageFamilyName"`
then then
instdir=`regtool get "$schema/$package/Schemas/PackageFullName"` instdir=`regtool get "$schema/$package/Schemas/PackageFullName"`
# get actual executable path (may not match $distro) from the app manifest # get actual executable path (may not match $distro) from the app manifest
manifest="$ProgramW6432/WindowsApps/$instdir/AppxManifest.xml" manifest="$ProgramW6432/WindowsApps/$instdir/AppxManifest.xml"
psh_cmd='([xml]$(Get-Content '"\"$manifest\""')).Package.Applications.Application.Executable' psh_cmd='([xml]$(Get-Content '"\"$manifest\""')).Package.Applications.Application.Executable'
executable=`powershell "$psh_cmd"` executable=`powershell "$psh_cmd"`
# remove trailing newline that above command introduces # remove trailing newline that above command introduces
executable="${executable%"${executable##*[![:space:]]}"}" executable="${executable%"${executable##*[![:space:]]}"}"
if [ -r "$ProgramW6432/WindowsApps/$instdir/$executable" ] if [ -r "$ProgramW6432/WindowsApps/$instdir/$executable" ]
then icon="%PROGRAMFILES%\\WindowsApps\\$instdir\\$executable" then icon="%PROGRAMFILES%\\WindowsApps\\$instdir\\$executable"
else icon="%LOCALAPPDATA%/wsltty/wsl.ico" else icon="%LOCALAPPDATA%/wsltty/wsl.ico"
fi else
icon="%LOCALAPPDATA%/lxss/bash.ico"
root="$basepath"
fi
minttyargs='--wsl --rootfs="'"$root"'" --configdir="%APPDATA%\wsltty" -o Locale=C -o Charset=UTF-8 /bin/wslbridge ' minttyargs='--wsl --rootfs="'"$root"'" --configdir="%APPDATA%\wsltty" -o Locale=C -o Charset=UTF-8 /bin/wslbridge '
minttyargs='--WSL="'"$distro"'" --configdir="%APPDATA%\wsltty"' minttyargs='--WSL="'"$distro"'" --configdir="%APPDATA%\wsltty"'
#if [ -z "$launch" ] #if [ -z "$launch" ]
#then bridgeargs='-t /bin/bash' #then bridgeargs='-t /bin/bash'
#else bridgeargs='-l "'"$launch"'" -t /bin/bash' #else bridgeargs='-l "'"$launch"'" -t /bin/bash'
#fi #fi
bridgeargs='--distro-guid "'"$guid"'" -t /bin/bash' bridgeargs='--distro-guid "'"$guid"'" -t /bin/bash'
bridgeargs='--distro-guid "'"$guid"'" -t' bridgeargs='--distro-guid "'"$guid"'" -t'
ok=true;; ok=true;;
"") # WSL default installation "") # WSL default installation
distro= distro=
name=WSL name=WSL
icon="%LOCALAPPDATA%/wsltty/wsl.ico" icon="%LOCALAPPDATA%/wsltty/wsl.ico"
@ -219,7 +222,7 @@ do
# default desktop shortcut in ~ -> Desktop # default desktop shortcut in ~ -> Desktop
if [ "$name" = "WSL" ] if [ "$name" = "WSL" ]
then cmd /C copy "$name Terminal.lnk" "%USERPROFILE%\\Desktop" then cmd /C copy "$name Terminal.lnk" "%USERPROFILE%\\Desktop"
fi fi
# launch script in ~ -> WSLtty home, WindowsApps launch folder # launch script in ~ -> WSLtty home, WindowsApps launch folder