1
0
mirror of https://github.com/mintty/wsltty.git synced 2025-11-07 10:31:51 +00:00

Compare commits

..

13 Commits
0.1.0 ... 0.6.2

Author SHA1 Message Date
mintty
a6d96ff1a2 0.6.2 2016-10-07 20:34:37 +02:00
mintty
74cb9ea92b Use new mintty option --dir, simplifying registry entry for context menu and dropping the need for dash.exe 2016-09-29 14:53:34 +02:00
mintty
eef97b91d7 Added Configuration instructions 2016-09-29 14:53:19 +02:00
mintty
480bbce851 0.6.0 2016-09-19 00:46:51 +02:00
mintty
f5df7b32d3 wsl.bat script to invoke wsltty manually (#3) 2016-09-18 22:26:47 +02:00
mintty
91c1b89050 start in Windows profile directory (#3) and set terminal charset 2016-09-18 12:06:23 +02:00
mintty
ff527bcd12 providing uninstaller (for manual invocation) 2016-09-16 13:58:30 +02:00
mintty
a6e090a37c 0.5.1 2016-09-16 13:37:04 +02:00
mintty
abe617cfc8 remove test entry skipping actual software installation :( 2016-09-16 13:35:42 +02:00
mintty
95203252b8 link "installer" to releases 2016-09-16 12:50:22 +02:00
mintty
ab34967e50 0.5 2016-09-14 15:37:55 +02:00
mintty
15e94574c6 2016-09-14 14:55:14 +02:00
mintty
aab1ef4bad create user home directory instead of etc for .minttyrc (#1) 2016-09-11 22:04:45 +02:00
7 changed files with 155 additions and 14 deletions

Binary file not shown.

40
README.md Normal file
View File

@@ -0,0 +1,40 @@
Mintty as a terminal for Bash on Ubuntu on Windows / WSL.
### Overview ###
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)
* 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
* context menu entries for Windows Explorer to start WSL with a bash in the respective directory
* a script `wsl.bat` to invoke wsltty manually; copy the script from `%LOCALAPPDATA%\wsltty` to `%SYSTEMROOT%\System32` if desired
* an uninstall script that can be invoked manually to remove shortcuts and context menu entries
### Configuration ###
#### Command line script wsl.bat ####
* To enable invocation of this script from WIN+R or from cmd.exe,
copy it from `%LOCALAPPDATA%\wsltty` into `%SYSTEMROOT%\System32`.
(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`.
* In the script (or a copy for this purpose), add `-C~` as first parameter of `wslbridge`: `... /bin/wslbridge -C~ -t /bin/bash -l`.
#### Desktop shortcut and Start menu shortcut ####
To enforce starting in your Linux home directory, do *either* of:
* On Linux side, add a `cd` command to your `$HOME/.profile`.
* Open Shortcut Properties; in the Target, add `-C~` as first parameter of `wslbridge`: `... /bin/wslbridge -C~ -t /bin/bash -l`.
### Components ###
For mintty, see the [Mintty homepage](http://mintty.github.io/).
It is based on [Cygwin](http://cygwin.com)
and includes its runtime library ([sources](http://mirrors.dotsrc.org/cygwin/x86/release/cygwin)).
For interacting with WSL, it uses [wslbridge](https://github.com/rprichard/wslbridge).

View File

@@ -1,15 +1,71 @@
@echo off
rem @echo off
:deploy
mkdir "%LOCALAPPDATA%\wsltty"
mkdir "%LOCALAPPDATA%\wsltty\bin"
mkdir "%LOCALAPPDATA%\wsltty\etc"
copy LICENSE.mintty "%LOCALAPPDATA%\wsltty"
copy LICENSE.wslbridge "%LOCALAPPDATA%\wsltty"
copy etc/minttyrc "%LOCALAPPDATA%\wsltty\etc"
copy uninstall.bat "%LOCALAPPDATA%\wsltty"
copy wsl.bat "%LOCALAPPDATA%\wsltty"
rem does not work without admin rights:
rem copy wsl.bat "%SYSTEMROOT%\System32"
mkdir "%LOCALAPPDATA%\wsltty\bin"
copy cygwin1.dll "%LOCALAPPDATA%\wsltty\bin"
copy cygwin-console-helper.exe "%LOCALAPPDATA%\wsltty\bin"
rem copy dash.exe "%LOCALAPPDATA%\wsltty\bin"
copy mintty.exe "%LOCALAPPDATA%\wsltty\bin"
copy wslbridge.exe "%LOCALAPPDATA%\wsltty\bin"
copy wslbridge-backend "%LOCALAPPDATA%\wsltty\bin"
rem create "home directory" to enable storage of config file
mkdir "%LOCALAPPDATA%\wsltty\home
mkdir "%LOCALAPPDATA%\wsltty\home\%USERNAME%"
:shortcuts
rem create Desktop Shorcut
copy "Bash on UoW in Mintty.lnk" "%USERPROFILE%\Desktop"
rem create Start Menu Shortcut
copy "Bash on UoW in Mintty.lnk" "%APPDATA%\Microsoft\Windows\Start Menu"
: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=%LOCALAPPDATA%\wsltty\bin\mintty.exe
set cset=-o Locale=C -o Charset=UTF-8
set icon=%LOCALAPPDATA%\lxss\bash.ico
set arg=/bin/wslbridge -t %shell%
set target0=\"%cmd%\" %cset% -i \"%icon%\" %arg%
rem set target1=\"%cmd%\" %cset% -i \"%icon%\" /bin/dash -c \"cd '%%1'; exec %arg%\"
set target1=\"%cmd%\" %cset% -i \"%icon%\" --dir \"%%1\" %arg%
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

@@ -2,8 +2,8 @@
# default: generate all
all: wslbridge mintty cygwin wsltty pkg
wslbridgever=0.1.0
ver=$(wslbridgever)
ver=0.6.2
wslbridgever=0.2.0
TARGET := $(shell $(CC) -dumpmachine)
@@ -19,19 +19,22 @@ else
$(error Target '$(TARGET)' not supported)
endif
wget=curl -R -L -O --connect-timeout 55
#############################################################################
# generation
wslbridge:
wget https://github.com/rprichard/wslbridge/releases/download/$(wslbridgever)/wslbridge-$(wslbridgever)-$(sys).tar.gz -O wslbridge-$(wslbridgever)-$(sys).tar.gz
$(wget) https://github.com/rprichard/wslbridge/releases/download/$(wslbridgever)/wslbridge-$(wslbridgever)-$(sys).tar.gz
tar xvzf wslbridge-$(wslbridgever)-$(sys).tar.gz
mkdir -p bin
cp wslbridge-$(wslbridgever)-$(sys)/wslbridge* bin/
cp wslbridge-$(wslbridgever)-$(sys)/LICENSE.txt LICENSE.wslbridge
mintty:
wget https://github.com/mintty/mintty/archive/master.zip -O mintty.zip
unzip mintty.zip
$(wget) https://github.com/mintty/mintty/archive/master.zip
mv master.zip mintty-master.zip
unzip -o mintty-master.zip
cd mintty-master/src; make LDFLAGS="-static -static-libgcc -s"
mkdir -p bin
cp mintty-master/bin/mintty.exe bin/
@@ -41,24 +44,25 @@ cygwin:
mkdir -p bin
cp /bin/cygwin1.dll bin/
cp /bin/cygwin-console-helper.exe bin/
#cp /bin/dash.exe bin/
wsltty:
mkdir -p etc
touch etc/minttyrc
pkg:
mkdir -p rel
sed -e "s,%version%,$(ver)," makewinx.cfg > rel/wsltty.SED
cp bin/cygwin1.dll rel/
cp bin/cygwin-console-helper.exe rel/
#cp bin/dash.exe rel/
cp bin/mintty.exe rel/
cp bin/wslbridge.exe rel/
cp bin/wslbridge-backend rel/
cp LICENSE.mintty rel/
cp LICENSE.wslbridge rel/
cp etc/minttyrc rel/
cp "Bash on UoW in Mintty.lnk" rel/
cp wsl.bat rel/
cp install.bat rel/
cp uninstall.bat rel/
cd rel; iexpress /n wsltty.SED
#############################################################################

View File

@@ -39,9 +39,10 @@ FILE3="wslbridge.exe"
FILE4="wslbridge-backend"
FILE5="LICENSE.mintty"
FILE6="LICENSE.wslbridge"
FILE7="minttyrc"
FILE8="Bash on UoW in Mintty.lnk"
FILE7="Bash on UoW in Mintty.lnk"
FILE8="wsl.bat"
FILE9="install.bat"
FILE10="uninstall.bat"
[SourceFiles]
SourceFiles0=.
@@ -57,4 +58,5 @@ SourceFiles0=.
%FILE7%=
%FILE8%=
%FILE9%=
%FILE10%=

27
uninstall.bat Executable file
View File

@@ -0,0 +1,27 @@
@echo off
:undeploy
rem currently not removing software
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 "%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

12
wsl.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" -o Locale=C -o Charset=UTF-8 -i "%LOCALAPPDATA%\lxss\bash.ico" /bin/wslbridge -t /bin/bash -l