18

I just installed the new Linux subsystem in Windows 10. It's really nice to have access to the Ubuntu repositories, but I absolutely HATE the default terminal program. Cygwin comes with MinTTY which is really nice and works very well, but I can't find a standalone package for MinTTY. Is there a way to make MinTTY as a default terminal for WSL, when launching whatever shortcut?

Edit: to be clear, I DON'T want to install Cygwin. I want to use the new Linux subsystem and its bash shell, but I want to use mintty as my terminal.

5
  • 2
    There are a few comments on the BashOnLinux Github issues tracker, such as this one github.com/Microsoft/BashOnWindows/issues/… and also on the mintty issue tracker: github.com/mintty/mintty/issues/558 We're not there yet...
    – Seb
    Commented Aug 5, 2016 at 6:59
  • If you don't mind, I'm curious about your use case and why you insist on the Ubuntu bash rather than Cygwin. Are you developing for distribution on Ubuntu? The reason I ask because this new Ubuntu bash seems impossibly crippled in most respects compared to the Cygwin bash. For example, It can only start genuine Ubuntu binaries, meaning it can't even start notepad. I'm fascinated to know what people will do with this. Commented Aug 28, 2016 at 19:36
  • @NicoleHamilton Cygwin doesn't have access to apt repos. If I want to install a new program and have it work with cygwin, I either have to install through cygwin using the Graphical installer, which can be a bit of a pain, or I have to install a windows binary, then add it to my path, which can also be a pain. Cygwin is a useful tool if you want a bash-like terminal in a windows environment, but is limited by the fact that it isn't linux.
    – ewok
    Commented Aug 28, 2016 at 19:41
  • Also there are programs that only run on Linux (without putting extensive effort into porting). Much easier to run Bash than to start a virtual machine.
    – Ben Fulton
    Commented Aug 30, 2016 at 2:45
  • It's possible, as long as you use a couple of wrappers that depend on some cygwin bits (particularly wslbridge) - installing cygwin (or at least having the dlls in place as per Gore Liu's answer) is currently your best bet. I've answered below with what I've found to be the simplest way to get it running.
    – Seb
    Commented Sep 10, 2016 at 21:42

5 Answers 5

19

The mintty developer has just released an installer that will set it all up for you with no external dependencies (it includes cygwin dll, the console helper and wslbridge):

https://github.com/mintty/wsltty/releases

Download, install and you're done.

If you want to run a different shell than Bash, just change the shortcut (in your startmenu). For example, to run ssh-agent per terminal with zsh:

%LOCALAPPDATA%\wsltty\bin\mintty.exe /bin/wslbridge -t /usr/bin/ssh-agent /bin/zsh -l
0
5

Using mintty + wslbridge works.

Download 3 files:

mirrors.kernel.org/sourceware/cygwin/x86_64/release/cygwin/cygwin-2.5.2-1.tar.xz

mirrors.kernel.org/sourceware/cygwin/x86_64/release/mintty/mintty-2.4.2-0.tar.xz

github.com/rprichard/wslbridge/releases/download/0.1.0/wslbridge-0.1.0-cygwin64.tar.gz

Put these files to the same directory named bin:

cygwin1.dll : cygwin-2.5.2-1.tar.xz

cygwin-console-helper.exe : cygwin-2.5.2-1.tar.xz

mintty.exe : mintty-2.4.2-0.tar.xz

wslbridge.exe : wslbridge-0.1.0-cygwin64.tar.gz

wslbridge-backend : wslbridge-0.1.0-cygwin64.tar.gz

And create an empty minttyrc.

Run mintty -c ./minttryc ./wslbridge

Or use Terminal emulator for Windows Subsystem for Linux (WSL)

1

I just created a shortcut which points to the following location:

C:\msys64\usr\bin\mintty.exe --icon C:\Windows\System32\wsl.exe --dir //wsl.localhost/ubuntu_20.04/home/<user> --wsl -t WSL -s 240,60 -e wsl

where:

  • C:\msys64\ is msys2 root directory;
  • ubuntu_20.04 is my WSL distribution. You can get it by wsl -l -v;
  • with --dir ... I can enter my WSL home directory by default, otherwise I will enter msys2/mintty home directory default. Besides, when you press ctrl key and hover mouse to a file and click it, this allows mintty to launch an external application to open the file.
  • -e wsl tells mintty to run wsl.exe command;
  • For other command line options, see https://mintty.github.io/mintty.1.html.

This works for me. You may try https://github.com/mintty/wsltty as well. Seems it has integrated with wslbridge2, but I didn't notice the difference.

1
  • Avoid posting answers to old questions that already got well received answers unless you have something substantial and new to add.
    – Toto
    Commented Aug 23, 2023 at 8:46
0

I would mark Seb's as the correct answer, but this information will help me (and hopefully others) in the future.

I create a shortcut and put it on my taskbar.

  1. Download and install latest https://github.com/mintty/wsltty/releases
  2. Create a new shortcut somewhere (right click -> new -> shortcut)
  3. Right click on the shortcut and click Properties
  4. Fill in the "Target" field with %LOCALAPPDATA%\wsltty\bin\mintty.exe --tabbar=4 -o "KeyFunctions=t:new-window-cwd;w:close" --WSL="Ubuntu" --configdir="%APPDATA%\wsltty" -h always -
    1. Modify where appropriate. e.g., Maybe you are not using Ubuntu.

    2. You may want to remove the -o "KeyFunctions=t:new-window-cwd;w:close". This makes ctrl + shift + t/w open and close a new tab, respectively.

    3. I just added that -h always and I don't know if it should remain there. But it's good to have initially because it makes it so that the window stays open if it crashes. This will allow you to see the error, whereas without this, the window would close.

      UPDATE: I removed this eventually. Unfortunately, I can't remember why. Perhaps closing the window with the aforementioned shortcuts kept the terminal open.

  5. Fill in the "Start in" field with the directory you want the terminal to start in. This uses a Windows path. If you want to start in your WSL home directory, the path will look like this: \\wsl$\Ubuntu\home\<your username>
  6. Drag this shortcut into your taskbar and pin it.
-5

Original thread.

Here's how to do it, run mintty under bash.

  1. Download mintty from here.

  2. Unzip and Extract mintty.exe

  3. Go to your bin folder where you installed Git. The default location is : C:\Program Files (x86)\Git\bin

  4. Right click on windows shortcut for Git Bash

  5. Set target to :

C:\Program Files (x86)\Git\bin\mintty.exe" /bin/sh --login -i

If download location is different, then change the location accordingly.

  1. Click on Git Bash shortcut to launch it.
1
  • 3
    This doesn't use the new Linux Subsystem, it uses the bash provided by Git for Windows...
    – Seb
    Commented Aug 5, 2016 at 6:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .