All Projects → mskyaxl → Wsl Terminal

mskyaxl / Wsl Terminal

Licence: mit
Terminal emulator for Windows Subsystem for Linux (WSL)

Programming Languages

shell
77523 projects
autohotkey
350 projects
javascript
184084 projects - #8 most used programming language
Batchfile
5799 projects

Projects that are alternatives of or similar to Wsl Terminal

Awesome Wsl
Awesome list dedicated to Windows Subsystem for Linux
Stars: ✭ 3,544 (+13.59%)
Mutual labels:  wsl, windows-subsystem-linux
wsl2exe
[TESTING]Use command in WSL from exe executable
Stars: ✭ 34 (-98.91%)
Mutual labels:  wsl, windows-subsystem-linux
Extraterm
The swiss army chainsaw of terminal emulators
Stars: ✭ 1,922 (-38.4%)
Mutual labels:  wsl, windows-subsystem-linux
Wslreverse
Experiments with hidden COM interface and LxBus IPC mechanism in WSL
Stars: ✭ 47 (-98.49%)
Mutual labels:  wsl, windows-subsystem-linux
WSL-manager
unofficial gui manager for Windows Subsystem for Linux (WSL)
Stars: ✭ 25 (-99.2%)
Mutual labels:  wsl, windows-subsystem-linux
Wsl Guideline
WSL(Windows Subsystem for Linux) Guideline / WSL 使用指南
Stars: ✭ 122 (-96.09%)
Mutual labels:  wsl, windows-subsystem-linux
Alpinewsl
Alpine Linux based WSL distribution. Supports multi-install. Lightest WSL distribution.
Stars: ✭ 203 (-93.49%)
Mutual labels:  wsl, windows-subsystem-linux
Wsldl
Advanced WSL launcher / installer. (Win10 FCU x64/arm64 or later.)
Stars: ✭ 782 (-74.94%)
Mutual labels:  wsl, windows-subsystem-linux
Archwsl
ArchLinux based WSL Distribution. Supports multiple install.
Stars: ✭ 3,667 (+17.53%)
Mutual labels:  wsl, windows-subsystem-linux
Wsl Dotfiles
My dotfiles for running an i3-based environment within the Windows Subsystem for Linux (WSL).
Stars: ✭ 211 (-93.24%)
Mutual labels:  wsl, windows-subsystem-linux
Wsl Programs
A community powered list of programs that work (and those that don't) on the Windows subsystem for Linux
Stars: ✭ 931 (-70.16%)
Mutual labels:  wsl, windows-subsystem-linux
Wsl Ssh Agent
Helper to interface with Windows ssh-agent.exe service from Windows Subsystem for Linux (WSL)
Stars: ✭ 298 (-90.45%)
Mutual labels:  wsl, windows-subsystem-linux
Wsl Docker Git Setup
Shell script to configure Windows Subsystem for Linux (WSL) & Ubuntu on Windows to use docker and docker-compose as well as a git-enabled prompt
Stars: ✭ 23 (-99.26%)
Mutual labels:  wsl, windows-subsystem-linux
Wslu
A collection of utilities for Windows 10 Linux Subsystems
Stars: ✭ 2,020 (-35.26%)
Mutual labels:  wsl, windows-subsystem-linux
Wslgit
Use Git installed in Bash on Windows/Windows Subsystem for Linux (WSL) from Windows and Visual Studio Code (VSCode)
Stars: ✭ 903 (-71.06%)
Mutual labels:  wsl, windows-subsystem-linux
Wslinstall
Install any GNU/Linux userspace in WSL
Stars: ✭ 178 (-94.29%)
Mutual labels:  wsl, windows-subsystem-linux
Wsl Ssh Pageant
A Pageant -> TCP bridge for use with WSL, allowing for Pageant to be used as an ssh-ageant within the WSL environment.
Stars: ✭ 381 (-87.79%)
Mutual labels:  wsl, windows-subsystem-linux
Centwsl
[DISCONTINUED] CentOS based WSL distribution
Stars: ✭ 766 (-75.45%)
Mutual labels:  wsl, windows-subsystem-linux
Lxrunoffline
A full-featured utility for managing Windows Subsystem for Linux (WSL)
Stars: ✭ 3,005 (-3.69%)
Mutual labels:  wsl, windows-subsystem-linux
uniterm
🚧Universal Terminal Emulator, might be a great toy terminal front-end for geeks.
Stars: ✭ 22 (-99.29%)
Mutual labels:  wsl, windows-subsystem-linux

wsl-terminal

A terminal emulator for Windows Subsystem for Linux (WSL), based on mintty, fatty and wslbridge2.

All emojis designed by OpenMoji – the open-source emoji and icon project. License: CC BY-SA 4.0

中文页面(The Chinese README is no longer maintained)

Screenshot

screenshot

More screenshots here.

Usage

  1. Make sure you have 7z installed. On Ubuntu run: sudo apt install p7zip-full, on Archlinux: run pacman -S p7zip

  2. Change the directory to the folder where you want to install wsl-terminal to.

Make sure to install wsl-terminal in a the windows filesystem and not in the wsl filesistem. The installation folder needs to be on a local NTFS volume.

  • Option 1: If you're in cmd.exe run:
wsl bash -c "$(wget https://raw.githubusercontent.com/mskyaxl/wsl-terminal/master/scripts/install.sh -qO -)"
  • Option 2: If you're in wsl already run
bash -c "$(wget https://raw.githubusercontent.com/mskyaxl/wsl-terminal/master/scripts/install.sh -qO -)"

If you want to install the tabbed version you have to add a -t as parameter as shown bellow

bash -c "$(wget https://raw.githubusercontent.com/mskyaxl/wsl-terminal/master/scripts/install.sh -qO -)" '' -t
  1. Run open-wsl.exe to open a WSL terminal in current directory.

  2. Run tools/1-add-open-wsl-terminal-here-menu.js (help) to add a Open wsl-terminal Here context menu to explorer.exe (Run tools/1-remove-open-wsl-terminal-here-menu.js to remove it). If you are using Total Commander, Use wsl-terminal with Total Commander may help you.

  3. run-wsl-file.exe can run any .sh (or any others like .py .pl) script files in wsl-terminal, support Open With context menu in explorer.exe.

  4. vim.exe can open any files with vim (in wsl-terminal), support Open With context menu in explorer.exe. vim.exe can be renamed to emacs.exe nvim.exe nano.exe ... to open files in emacs nvim nano ....

Keyboard shortcuts

key function
Alt + Enter Fullscreen
Alt + F2 New window
Alt + F3 Search text
Ctrl + [Shift] + Tab Switch window
Ctrl + = + - 0 Zoom
Ctrl + Click Open URL or dir/file under the cursor
Ctrl + Right Click Open context menu

Bind wsl-terminal to a hotkey.

Params

open-wsl

Usage: open-wsl [OPTION]...
  -a: activate an existing wsl-terminal window.
      if use_tmux=1, attach the running tmux session.
  -l: start a login shell and cd to $HOME (doesn't work with use_tmux=1).
  -c command: run command (e.g. -c "echo a b; echo c; cat").
  -e commands: run commands (e.g. -e echo a b; echo c; cat).
  -C dir: change directory to a WSL dir (e.g. /home/username).
  -W dir: change directory to a Windows dir (e.g. c:\Users\username).
  -d distro: switch distros.
  -b "options": pass additional options to wslbridge.
  -B "options": pass additional options to mintty.
  -h: show help.

For -B and -b, see also mintty params and wslbridge2 params.

cmdtool (run it in WSL)

Usage: cmdtool [OPTION]...
  wcmd: run Windows programs with cmd.exe /c.
  wstart: run Windows programs with cmd.exe /c start.
  wstartex file|url: like wstart, but use WSL file path.
  update: check the latest wsl-terminal version, and upgrade it.
  killall: kill all WSL processes.
  install dash: install Cygwin dash (for debugging).
  install busybox: install Cygwin busybox (for debugging).

Tools

Files in tools directory:

filename function
1-add-open-wsl-terminal-here-menu.js Add Open wsl-terminal Here context menu to explorer.exe.
1-remove-open-wsl-terminal-here-menu.js Remove Open wsl-terminal Here context menu.
2-add-wsl-terminal-dir-to-path.js Add wsl-terminal directory to Path environment variable.
2-remove-wsl-terminal-dir-from-path.js Remove wsl-terminal directory from Path environment variable.
3-write-distro-to-config-file.js Write distro guids to etc/wsl-terminal.conf.
4-create-start-menu-shortcut.js Create a start menu shortcut to open-wsl -C ~.
4-create-start-menu-shortcut-login-shell.js Create a start menu shortcut to open-wsl -l.
4-remove-all-start-menu-shortcuts.js Remove all wsl-terminal start menu shortcuts.
5-add-open-with-vim-menu.js Add Open with vim in wsl-terminal context menu.
5-remove-open-with-vim-menu.js Remove Open with vim in wsl-terminal context menu.
6-set-default-shell.bat Set shell in etc/wsl-terminal.conf to the default shell in WSL.

Double click any .js file to run it. If it was open by any editor, open it with Microsoft (R) Windows Based Script Host, or open a cmd.exe in tools directory and run wscript xxx.js.

Configuration files

etc/wsl-terminal.conf is wsl-terminal config file.

[config]
title="my title"
shell=/bin/bash
use_tmux=0
;icon=
;distro=

etc/themes/* are theme files, use themes.

etc/minttyrc is mintty config file, mintty tips.

Upgrade

Open open-wsl.exe in wsl-terminal directory, run ./cmdtool update to check the latest wsl-terminal version and upgrade it. If the download speed is too slow, you can download wsl-terminal-v{version}.7z from releases with other tools, and put it into wsl-terminal directory, then run ./cmdtool update.

wget and 7z commands are needed (Ubuntu: apt install wget p7zip-full, Archlinux: pacman -S wget p7zip) .

Config files won't be overridden, etc/wsl-terminal.conf and etc/minttyrc will be placed to etc/wsl-terminal.conf.pacnew and etc/minttyrc.pacnew. Some .bak files will be left in bin, because they are running, those files will be removed after the next upgrading.

Use tmux

  1. Install tmux in WSL.
  2. Set use_tmux=1 in etc/wsl-terminal.conf. And set attach_tmux_locally=1 if the version number is less than 0.8.1.
  3. Add these lines to ~/.bashrc (shell=/bin/bash in config) or ~/.zshrc (shell=/bin/zsh in config):
[[ -z "$TMUX" && -n "$USE_TMUX" ]] && {
    [[ -n "$ATTACH_ONLY" ]] && {
        tmux a 2>/dev/null || {
            cd && exec tmux
        }
        exit
    }

    tmux new-window -c "$PWD" 2>/dev/null && exec tmux a
    exec tmux
}

If you're using fish then update your '~/.config/fish/config.fish' (shell=/bin/fish in config) with

if [ -z "$TMUX" ]; and [ -n "$USE_TMUX" ]
    if [ -n "$ATTACH_ONLY" ]
        if not tmux a 2>/dev/null
            cd; and exec tmux
        end
        exit
    end

    tmux new-window -c "$PWD" 2>/dev/null; and exec tmux a
    exec tmux
end

Then open-wsl will use tmux.

Switch distros

Use open-wsl -d distro to switch distros:

# list all distros
> wslconfig /l
Legacy (Default)
Ubuntu

# use Ubuntu (will run wslconfig /s Ubuntu before mintty)
> open-wsl -d Ubuntu

# Ubuntu is the default distro now
> wslconfig /l
Ubuntu (Default)
kali-linux

Or set distro in wsl-terminal.conf (Won't change the default distro).

Run tools/3-write-distro-to-config-file.js (help), then a msgbox will show the result:

result has been written to ..\etc\wsl-terminal.conf:

;distro=kali-linux

;distro=Ubuntu

remove the ; before distro to use the distro.

If you want to pass the distro_guid to open-wsl in cmdline:


# pass the distro guid to wslbridge
> open-wsl -b "-d Ubuntu"

Links

FAQ

Issues

Releases

Wiki

Build

Prerequisites

  • Install WSL and make sure wget tar xz gzip p7zip are available (Ubuntu: run apt install wget tar xz-utils gzip p7zip-full, Archlinux: run pacman -S wget tar xz gzip p7zip) are installed in WSL.
  • for the tabbed version: cygwin x64 with the following packages installed gcc-g++, make, w32api-headers (for compiling fatty)

Build steps

  • clone the repo in WSL(to maintain the linux EOL characters) but on windows drive eg (/mnt/c/Users/<userName>/work/wsl-terminal)

  • use build.sh to build with the appropiate parameters.

    ➜  wsl-terminal git:(master) scripts/build.sh -h
    Usage:
        build.sh -h                 Display this help message.
        build.sh -a                 Builds wsl-terminal and wsl-terminal-tabbed.
        build.sh -t                 Builds only wsl-terminal-tabbed(cygwin is required).
        build.sh                    Builds only wsl-terminal.
    

Roadmap

  1. Bug fixing
  2. add x11 support

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].