# Using putty or other program to provide a terminal for Windows Bash

I've seen plenty of questions on how to copy-paste in and out of windows bash. Answers range from tough luck to using screen, which may not be for everyone. This is even worse for vim users, since you can't effectively use the clipboard to paste code into vim properly (a regular non-vim paste such as right click will cause many formatting issues).

It recently occurred to me there are quite a few emulators which work nicely as a Linux user expects - putty, git bash, I think cygwin as well but I haven't used that in ages.

This will allow this much wanted functionality - shift-insert pasting and an easy mark copy, plus allowing vim to access the clipboard via the " register.

Does anyone have an idea on how to make windows bash use one of these as a terminal, even from within, as another process?

To be clear, I know of all the workarounds (quick edit mode, using screen, etc...). Screen is probably the best. I'm looking for specifically using the terminal from some other program as an alternative, since this would be a true solution (if possible of course!).

• You can paste in putty session or even editing a vim file using your windows clipboard just pressing shift+insert – OscarAkaElvis Oct 22 '17 at 8:54
• Yeah I know that's the reason why this is a comment and not an answer. – OscarAkaElvis Oct 22 '17 at 10:01

WSL Terminal is a terminal emulator for Windows Bash, based on mintty and wslbridge.

it

contains run-wsl-file.exe(can run any .sh/.py/.pl/.php/... script files in wsl-terminal) and vim.exe(can open any text files in vim, support Open With context menu in explorer.exe. vim.exe can be renamed to emacs.exe/nvim.exe/nano.exe/less.exe/... to open files in emacs/nvim/nano/less/...).

And it contains tmux too.

A word from OP

This is awesome, as it solves completely the copy-paste problems. It can be integrated into the window manager, and changing the bash shortcut to

C:\path\to\wsl-terminal\open-wsl.exe -l


will start a bash terminal in home just like running 'bash for windows'. Finally, this is very lightweight requires no installation.

• @spiral you've got it - amend your answer with a brief overview of wsl-terminal and get your internet points. – kabanus Oct 22 '17 at 11:29
If you are (like me) used to the Putty console and already have CygWin installed, then you should use wslbridge (part of wsltty and WSL Terminal anyway) and bridge it to PuttyTray. It's easy to compile. Then you open up PuttyTray.exe select Cygwin mode and type in wslbridge.exe (or whatever binary name you used when copying/installing) in the Command box.