1
0
mirror of https://github.com/mintty/wsltty.git synced 2024-10-05 18:31:04 +01:00

updates for release 0.7.0

This commit is contained in:
Thomas Wolff 2016-11-16 16:46:50 +01:00
parent 81b586a86a
commit ae637e4645
15 changed files with 167 additions and 115 deletions

View File

@ -3,31 +3,36 @@ Mintty as a terminal for Bash on Ubuntu on Windows / WSL.
### Overview ### ### Overview ###
Run the [installer](https://github.com/mintty/wsltty/releases) to install Run the [installer](https://github.com/mintty/wsltty/releases) to install
* wsltty package components (see below) in the users application directory (where WSL is also installed) * wsltty package components (see below) in the users application folder (where WSL is also installed)
* an empty wsltty “home directory” to enable storage of a mintty config file * an empty wsltty “home directory” to enable storage of a mintty config file
* a Desktop Shortcut and a Start Menu Shortcut to start WSL with a login bash in the *Windows user profile* directory; to start in the Linux home directory instead, add a `cd` command to your Linux `$HOME/.profile` script * Start Menu and Desktop shortcuts to start a WSL bash (with some variations, see below)
* context menu entries for Windows Explorer to start WSL with a bash in the respective directory * optional context menu entries for Windows Explorer to start a WSL bash in the respective folder, installable from the Start Menu subfolder
* a script `wsl.bat` to invoke wsltty manually; copy the script from `%LOCALAPPDATA%\wsltty` to `%SYSTEMROOT%\System32` if desired * `wsl*.bat` scripts to invoke wsltty manually (with some variations and invocation options, see below)
* an uninstall script that can be invoked manually to remove shortcuts and context menu entries * an uninstall script that can be invoked manually to remove shortcuts and context menu entries
### Configuration ### ### Configuration ###
#### Command line scripts wsl.bat and wsl~.bat #### #### Command line scripts wsl*.bat ####
* To enable invocation of this script from WIN+R or from cmd.exe, WSLtty installs the following scripts in its application folder `%LOCALAPPDATA%\wsltty`:
copy it from `%LOCALAPPDATA%\wsltty` into `%SYSTEMROOT%\System32`. * `wsl.bat` to start a WSL bash in the current folder/directory
* `wsl~.bat` to start a WSL bash in the WSL user home
* `wsl-l.bat` to start a WSL login bash
To enable invocation of these scripts from WIN+R or from cmd.exe,
copy them from `%LOCALAPPDATA%\wsltty` into `%SYSTEMROOT%\System32`,
renaming them as desired.
(The package does not do this to avoid trouble with missing admin privileges.) (The package does not do this to avoid trouble with missing admin privileges.)
* To start the terminal in the current directory when calling the script from the command line,
modify it (or a copy for this purpose) and remove the final `-l` parameter.
* To enforce starting in your Linux home directory, do *either* of:
* On Linux side, add a `cd` command to your `$HOME/.profile`.
* Use `wsl~.bat` instead of `wsl.bat` (or rename it as desired).
#### Desktop shortcut and Start menu shortcut #### #### Start Menu and Desktop shortcuts ####
To enforce starting in your Linux home directory, do *either* of: The Start Menu subfolder WSLtty offers three shortcuts:
* On Linux side, add a `cd` command to your `$HOME/.profile`. * `WSL Bash % in Mintty` to start a WSL bash in the Windows %USERPROFILE% home
* Use the shortcut `Bash ~ on UoW in Mintty` instead. * `WSL Bash ~ in Mintty` to start a WSL bash in the WSL user home
* `WSL Bash -l in Mintty` to start a WSL login bash
To ensure a login bash to start in your Linux home directory,
add a `cd` command to your `$HOME/.profile` on Linux side.
#### Mintty settings #### #### Mintty settings ####

BIN
WSL Bash ~ in Mintty.lnk Executable file

Binary file not shown.

39
add to context menu.bat Normal file
View File

@ -0,0 +1,39 @@
@echo off
rem See comments in install.bat about changing the installation directory.
set installdir=%LOCALAPPDATA%\wsltty
rem Explorer context menu
set userdirname=HKEY_CURRENT_USER\Software\Classes\Directory\shell
set userdirpane=HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell
rem WSL in Mintty
set label=WSL in Mintty
rem set here=in this directory
set here=Here
rem WSL icon
set icon=%LOCALAPPDATA%\lxss\bash.ico
rem WSL target shell
set shell=/bin/bash
rem Mintty invocation
set cmd=%installdir%\bin\mintty.exe
set cset=-o Locale=C -o Charset=UTF-8
set opts=--wsl
set arg=/bin/wslbridge -t %shell%
set target0=\"%cmd%\" %opts% %cset% -i \"%icon%\" %arg%
rem set target1=\"%cmd%\" %opts% %cset% -i \"%icon%\" /bin/dash -c \"cd '%%1'; exec %arg%\"
set target1=\"%cmd%\" %opts% %cset% -i \"%icon%\" --dir \"%%1\" %arg%
rem Registry entries
reg add "%userdirname%\wsltty" /d "%label% %here%" /f
reg add "%userdirname%\wsltty" /v Icon /d "%icon%" /f
reg add "%userdirname%\wsltty\command" /d "%target1%" /f
reg add "%userdirpane%\wsltty" /d "%label% %here%" /f
reg add "%userdirpane%\wsltty" /v Icon /d "%icon%" /f
reg add "%userdirpane%\wsltty\command" /d "%target0%" /f
:end

View File

@ -1,9 +1,10 @@
rem @echo off @echo off
rem If you change the installation directory, rem If you change the installation directory,
rem it also needs to be adapted in rem it also needs to be adapted in
rem - the Shortcut links *.lnk rem - the Shortcut links *.lnk
rem - the cmd invocation scripts wsl*.bat rem - the cmd invocation scripts wsl*.bat
set installdir=%LOCALAPPDATA%\wsltty set installdir=%LOCALAPPDATA%\wsltty
@ -16,9 +17,13 @@ copy uninstall.bat "%installdir%"
copy wsl.bat "%installdir%" copy wsl.bat "%installdir%"
copy wsl~.bat "%installdir%" copy wsl~.bat "%installdir%"
copy wsl-l.bat "%installdir%"
copy "add to context menu.bat" "%installdir%"
copy "remove from context menu.bat" "%installdir%"
rem does not work without admin rights: rem does not work without admin rights:
rem copy wsl.bat "%SYSTEMROOT%\System32" rem copy wsl.bat "%SYSTEMROOT%\System32"
rem copy wsl~.bat "%SYSTEMROOT%\System32" rem copy wsl~.bat "%SYSTEMROOT%\System32"
rem copy wsl-l.bat "%SYSTEMROOT%\System32"
mkdir "%installdir%\bin" mkdir "%installdir%\bin"
copy cygwin1.dll "%installdir%\bin" copy cygwin1.dll "%installdir%\bin"
@ -35,48 +40,18 @@ mkdir "%installdir%\home\%USERNAME%"
:shortcuts :shortcuts
rem create Desktop Shorcut rem create Start Menu Folder
copy "Bash on UoW in Mintty.lnk" "%USERPROFILE%\Desktop" set smf=%APPDATA%\Microsoft\Windows\Start Menu\Programs\WSLtty
copy "Bash ~ on UoW in Mintty.lnk" "%USERPROFILE%\Desktop" mkdir "%smf%"
copy "wsltty home & help.url" "%smf%"
copy "WSL Bash % in Mintty.lnk" "%smf%"
copy "WSL Bash ~ in Mintty.lnk" "%smf%"
copy "WSL Bash -l in Mintty.lnk" "%smf%"
mkdir "%smf%\context menu shortcuts"
rem create Start Menu Shortcut rem create Desktop Shorcuts
copy "Bash on UoW in Mintty.lnk" "%APPDATA%\Microsoft\Windows\Start Menu" copy "WSL Bash % in Mintty.lnk" "%USERPROFILE%\Desktop"
copy "Bash ~ on UoW in Mintty.lnk" "%APPDATA%\Microsoft\Windows\Start Menu" copy "WSL Bash ~ in Mintty.lnk" "%USERPROFILE%\Desktop"
:explorer
rem Explorer context menu
set userdirname=HKEY_CURRENT_USER\Software\Classes\Directory\shell
set userdirpane=HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell
rem WSL in Mintty
set label=WSL in Mintty
rem set here=in this directory
set here=Here
rem WSL icon
set icon=%LOCALAPPDATA%\lxss\bash.ico
rem WSL target shell
set shell=/bin/bash
rem Mintty invocation
set cmd=%installdir%\bin\mintty.exe
set cset=-o Locale=C -o Charset=UTF-8
set opts=--wsl
set arg=/bin/wslbridge -t %shell%
set target0=\"%cmd%\" %opts% %cset% -i \"%icon%\" %arg%
rem set target1=\"%cmd%\" %opts% %cset% -i \"%icon%\" /bin/dash -c \"cd '%%1'; exec %arg%\"
set target1=\"%cmd%\" %opts% %cset% -i \"%icon%\" --dir \"%%1\" %arg%
rem Registry entries
reg add "%userdirname%\wsltty" /d "%label% %here%" /f
reg add "%userdirname%\wsltty" /v Icon /d "%icon%" /f
reg add "%userdirname%\wsltty\command" /d "%target1%" /f
reg add "%userdirpane%\wsltty" /d "%label% %here%" /f
reg add "%userdirpane%\wsltty" /v Icon /d "%icon%" /f
reg add "%userdirpane%\wsltty\command" /d "%target0%" /f
:end :end

View File

@ -97,14 +97,10 @@ pkg: wslbridge mintty cygwin wsltty
cp bin/mintty.exe rel/ cp bin/mintty.exe rel/
cp bin/wslbridge.exe rel/ cp bin/wslbridge.exe rel/
cp bin/wslbridge-backend rel/ cp bin/wslbridge-backend rel/
cp LICENSE.mintty rel/ cp LICENSE.* rel/
cp LICENSE.wslbridge rel/ cp *.lnk rel/
cp "Bash on UoW in Mintty.lnk" rel/ cp *.url rel/
cp "Bash ~ on UoW in Mintty.lnk" rel/ cp *.bat rel/
cp wsl.bat rel/
cp wsl~.bat rel/
cp install.bat rel/
cp uninstall.bat rel/
cd rel; iexpress /n wsltty.SED cd rel; iexpress /n wsltty.SED
############################################################################# #############################################################################

View File

@ -39,12 +39,17 @@ FILE3="wslbridge.exe"
FILE4="wslbridge-backend" FILE4="wslbridge-backend"
FILE5="LICENSE.mintty" FILE5="LICENSE.mintty"
FILE6="LICENSE.wslbridge" FILE6="LICENSE.wslbridge"
FILE7="Bash on UoW in Mintty.lnk" FILE7="WSL Bash % in Mintty.lnk"
FILE8="Bash ~ on UoW in Mintty.lnk" FILE8="WSL Bash ~ in Mintty.lnk"
FILE9="wsl.bat" FILE9="WSL Bash -l in Mintty.lnk"
FILE10="wsl~.bat" FILE10="wsl.bat"
FILE11="install.bat" FILE11="wsl~.bat"
FILE12="uninstall.bat" FILE12="wsl-l.bat"
FILE13="install.bat"
FILE14="uninstall.bat"
FILE15="add to context menu.bat"
FILE16="remove from context menu.bat"
FILE17="wsltty home & help.url"
[SourceFiles] [SourceFiles]
SourceFiles0=. SourceFiles0=.
@ -63,4 +68,9 @@ SourceFiles0=.
%FILE10%= %FILE10%=
%FILE11%= %FILE11%=
%FILE12%= %FILE12%=
%FILE13%=
%FILE14%=
%FILE15%=
%FILE16%=
%FILE17%=

View File

@ -0,0 +1,12 @@
@echo off
:explorer context menu
rem delete Explorer context menu
set userdirname=HKEY_CURRENT_USER\Software\Classes\Directory\shell
set userdirpane=HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell
reg delete "%userdirname%\wsltty" /f
reg delete "%userdirpane%\wsltty" /f
:end

View File

@ -1,5 +1,25 @@
@echo off @echo off
rem See comments in install.bat about changing the installation directory.
set installdir=%LOCALAPPDATA%\wsltty
:shortcuts
rem delete Start Menu Folder
set smf=%APPDATA%\Microsoft\Windows\Start Menu\Programs\WSLtty
rmdir /S /Q "%smf%"
rem delete Desktop Shortcuts
del "%USERPROFILE%\Desktop\WSL Bash % in Mintty.lnk"
del "%USERPROFILE%\Desktop\WSL Bash ~ in Mintty.lnk"
:explorer context menu
call "%installdir%\remove from context menu.bat"
:undeploy :undeploy
@ -7,23 +27,4 @@ rem currently not removing software
rem in any case, at least the config file (home\...) should not be removed rem in any case, at least the config file (home\...) should not be removed
:shortcuts
rem delete Desktop Shortcut and Start Menu Shortcut
del "%USERPROFILE%\Desktop\Bash on UoW in Mintty.lnk"
del "%USERPROFILE%\Desktop\Bash ~ on UoW in Mintty.lnk"
del "%APPDATA%\Microsoft\Windows\Start Menu\Bash on UoW in Mintty.lnk"
del "%APPDATA%\Microsoft\Windows\Start Menu\Bash ~ on UoW in Mintty.lnk"
:explorer
rem delete Explorer context menu
set userdirname=HKEY_CURRENT_USER\Software\Classes\Directory\shell
set userdirpane=HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell
reg delete "%userdirname%\wsltty" /f
reg delete "%userdirpane%\wsltty" /f
:end :end

12
wsl-l.bat Executable file
View File

@ -0,0 +1,12 @@
@echo off
rem Start mintty terminal for WSL in home directory
rem To enable invocation of this script from WIN+R or from cmd.exe,
rem you may want to copy this script into "%SYSTEMROOT%\System32"
rem You may want a variant of this script without trailing "-l"
rem to start in the current directory from cmd.exe
"%LOCALAPPDATA%\wsltty\bin\mintty.exe" --wsl -o Locale=C -o Charset=UTF-8 -i "%LOCALAPPDATA%\lxss\bash.ico" /bin/wslbridge -t /bin/bash -l

View File

@ -8,5 +8,5 @@ rem you may want to copy this script into "%SYSTEMROOT%\System32"
rem You may want a variant of this script without trailing "-l" rem You may want a variant of this script without trailing "-l"
rem to start in the current directory from cmd.exe rem to start in the current directory from cmd.exe
"%LOCALAPPDATA%\wsltty\bin\mintty.exe" --wsl -o Locale=C -o Charset=UTF-8 -i "%LOCALAPPDATA%\lxss\bash.ico" /bin/wslbridge -t /bin/bash -l "%LOCALAPPDATA%\wsltty\bin\mintty.exe" --wsl -o Locale=C -o Charset=UTF-8 -i "%LOCALAPPDATA%\lxss\bash.ico" /bin/wslbridge -t /bin/bash

2
wsltty home & help.url Normal file
View File

@ -0,0 +1,2 @@
[InternetShortcut]
URL=https://github.com/mintty/wsltty

View File

@ -8,5 +8,5 @@ rem you may want to copy this script into "%SYSTEMROOT%\System32"
rem You may want a variant of this script without trailing "-l" rem You may want a variant of this script without trailing "-l"
rem to start in the current directory from cmd.exe rem to start in the current directory from cmd.exe
"%LOCALAPPDATA%\wsltty\bin\mintty.exe" --wsl -o Locale=C -o Charset=UTF-8 -i "%LOCALAPPDATA%\lxss\bash.ico" /bin/wslbridge -C~ -t /bin/bash -l "%LOCALAPPDATA%\wsltty\bin\mintty.exe" --wsl -o Locale=C -o Charset=UTF-8 -i "%LOCALAPPDATA%\lxss\bash.ico" /bin/wslbridge -C~ -t /bin/bash