WindowsTerminal/Windows ComEmu

From Ever changing code
Jump to navigation Jump to search

ComEmu defaults key bindings

  • Apps + left/right - move between Windows/regions
  • Apps + Shift + - resize window/region
  • Ctrl + Win + Enter - maximize ConEmu window and hide window caption (FullScreen mode)
  • Ctrl + Tab, Ctrl+Shift+Tab - tabs switching, when lazy tab switching was started in recent mode, You may use Left and Right keys to select tabs directly
  • Win + 09 - activates consoles by numbers (1,2,3,4,5,6,7,8,9,0)
  • Win + W - create new console tab. Confirmation dialog will be displayed, when ‘Create confirmation’ setting is enabled
  • Win + Q, Win+Shift+Q - activate next/previous console tab
  • Win + Del - terminate current console
  • Win + S - duplicate tab with current state of root process.
  • Win + X - create new console tab with cmd.exe or some selected task. Linux subsystem in mine setup.
  • Apps + R - rename current tab. In the current ConEmu version Far Manager editors/viewers can not be renamed
  • Apps + F - search text in the console
  • Win + Alt + P - settings

ConEmu different shells

Bash on Windows (WSL)

Enable Windows Linux Subsystem

At Build 2016 Microsoft announced that Bash will be coming to Windows 10 via the future release of the Anniversary update. Made possible through the partnership of Microsoft & Canonical, this first class experience is made available natively a Windows desktop and required no VM to be run. The Windows Subsystem for Linux (WSL) is actually infrastructure within Windows operating a genuine Ubuntu user-mode Ubuntu image.

# open powershell as Administrator
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

Run ConEmu with Bash shell

Run from cmd/star menu/powershell. It requires newer version of ConEmu, that runs WSL via wslbridge.exe where {bash} is a default task. This version has fixed bug where the arrow keys do work now.

ConEmu64.exe -basic -run {bash}

Get arrows working in ConEmu

This solution is only for Bash on Windows (WSL). Due to the bug BashOnWindows#111 arrows may not be working in some cases if you start just a bash.exe.

StatusBar’s Terminal modes

RightClick on the StatusBar and enable Terminal modes column. Click on X located on the StatusBar it should be between [+] NUM X PRI and select XTerm and AppKeys when tab with Bash on Windows is active.

Explanation

When XTerm mode is turned on, ConEmu posts into the console input buffer ANSI sequences instead of native Windows key-codes. For example, Linux application expect to receive ^[[A instead of VK_UP.

However there are two notations, and some applications turns on App Keys mode to receive ^[OA instead of ^[[A. That is the problem, because without wslbridge ConEmu doesn’t receive the request to change the mode!

So, if keys are not working properly, it may mean that application expects another mode of App Keys. The solution is simple: just LeftClick the Terminal modes StatusBar column and change AppKeys mode.

WSL

Updates to WSL itself are automatically available through Windows Update, thus Windows build number is your WSL version.

cmd.exe /c "systeminfo" | grep "^OS Version"
OS Version:                10.0.17763 N/A Build 17763

References

Blogs

History