📜 ⬆️ ⬇️

Alternative terminal for Windows

Often confuse terminal and shell. In the same * nix there are shells (bash, csh, zsh, ...) and terminals (konsole / guake / yaquake / tilda, etc., etc.) For the Windows world, there is only one well-known terminal - a standard console window, which often mistakenly called “cmd.exe”. And few people know about the existence of many other terminal emulators. There are more known shells, there are two of them: cmd.exe and powershell.exe. And although there are at least three bash ports (MinGW, CygWin, GIT), many unixoids prefer to scold cmd.exe.

I was not satisfied with any of the found alternative terminals (as in 2009, when I began work on ConEmu , and now). It would seem that there are few requirements, here are the main ones:


Does ConEmu meet these requirements? The terminal (Free & OpenSource) is written by the programmer “for himself”, taking into account the wishes of other users of the program. In the minimum required configuration takes about 2 megabytes, which of course is more than a few kilobytes, but still negligible. Installation does not require, it can be portable if you create ConEmu.xml file next to ConEmu.exe . Does not depend on third-party libraries.


')

Feature Overview


It is impossible to tell “about everything” within one article, therefore only some functions are described here, in my opinion the most interesting to most users.

Visibility . Not only console headers can be displayed in tabs, but also additional information such as the active process, archiving progress, chkdsk, powershell, copying to Far Manager. For example, you do not need to switch to the tab to find out if the compilation of the project running in this tab has ended. In the status line, you can customize the list of displayed "columns" such as the coordinates of the visible area and the cursor, the PID of the active process in the console, the CAPS / NUM / SCRL statuses, the transparency coefficient, etc. Many columns are clickable, for example, you can click on the "column" with transparency for quick her changes.

Minimalist . The interface (the terminal itself, not the settings window) contains only two additional graphic elements - tabs and the status bar. But they can also be disabled if you prefer a “clean” console.

Portability Settings can be stored in the ConEmu.xml file created in the program folder.

Work with text . Two styles of text marking are supported - usual for text editors and “rectangular” as in a regular console. Marking and pasting text is convenient with both the keyboard and the mouse.

Quake / Tilda . Support game console mode. The terminal is able to “exit” when pressing the selected key combination (by default, Ctrl + ~) and hide when you lose focus or press Esc.

Run any applications . The user can configure any number of predefined tasks (Task) for quick launch in ConEmu or from the Windows 7 taskbar jump list. Task can launch one or several processes or shells (powershell, SDK, compilation of projects, etc.) You can even run simple GUI applications like PuTTY, TaskManager, GVim.

Work with color . Several predefined palettes (for example, Solarized, PowerShell, xterm, etc.), the ability to customize their console colors, support for ANSI X3.64 control codes, 24-bit color when working in Far Manager.

Integration . Able to add themselves (and selected shell commands) to the context menu of Windows Explorer. Able to intercept the creation of a standard terminal Windows.

Flexible configuration and management . In the Settings dialog you can find settings for every taste and color. You can assign a key combination to almost any action, and a simple macro language allows you to perform non-standard actions.

A bit of history


In the beginning was Zoin and his announcement of the console Emulator on the Far Manager forum. I don’t know if the author planned to develop the emulator, but in 2009 there were several forks offering various improvements: vertical scrolling, tabs for editors and Far viewers, displaying the context menu for files by right-clicking and dragging files between console Far and other applications. I liked the idea and, combining all the “patches”, I began to develop an emulator by adding new features and correcting bugs. At that time there were several alternatives (the most famous are Console2 of free and TakeCommand of paid), but none of them got accustomed. “I've been using the headlamp for 15 years,” so first of all I needed a shell for it.

Installation


ConEmu can be downloaded from of.sayta in two versions: the installer and 7z archive. In general, there is no difference between them, just the installer can create shortcuts and allows you to disable unnecessary parts of the product. I recommend trying the latest alpha versions, because Since the release of the last Stable, a lot of time has passed, many bugs have been fixed, many new features have appeared.

For bash followers, there are specially prepared MinGW packages on the project mirror. It is enough to deploy them into the MinGW folder so that “sh.exe –login –i” starts right away in ConEmu.

Users of Far Manager: for full-fledged work, ConEmu plug-ins must be downloaded to Far. Make sure that when using the installer, the plugins are installed in the Plugins subfolder of your Far.exe directory. Please note that the installer allows you to select the installation folder for both ConEmu itself and for Far plug-ins.

Antivirus users: the installer, like the ConEmu Trojan itself, does not contain, as they say, “the source code is open”.

When you first start the program will ask where you prefer to store the settings - in the file ConEmu.xml or in the registry.

Now you can run ConEmu.exe or ConEmu64.exe (there is no difference between the 32-bit and 64-bit versions).

By default, ConEmu starts one tab with the “preferred” shell at startup:


First start


When you first start the dialog “Fast configuration” is displayed, it contains several main options affecting the program.



Install keyboard hooks . ConEmu can take away certain key combinations from the system (when the program window is in focus). For example, Win + digit can be switched to a tab with a specific number. Almost all keyboard shortcuts with ConEmu are configured or disabled (Win + Alt + K), but if you don’t need to intercept combinations with the Win modifier at all, you can disable the checkbox.

Inject ConEmuHk.dll . Many features of ConEmu require interception of certain WinAPI functions. The ConEmuHk.dll library (or its 64-bit version of ConEmuHk64.dll) is embedded in the processes launched in the ConEmu tabs and intercepts functions through import sections. Unfortunately, the intercepted functions become more and more and the interception time increases accordingly. And although the numbers are only milliseconds, some users complain about the slowdown in the execution of commands in ConEmu. If you are one of them - disable this checkbox. Plans to try to switch to interception in the style of detours, perhaps it will speed up the process.

Enable automatic updates . I think the translation does not need. The update is performed in the same way as during the installation. That is, if you installed ConEmu by unpacking the 7z archive, then an archiver (7 – zip or WinRar) will be required for the update.

Customization


In principle, ConEmu works immediately and does not require configuration, but any user / admin / programmer has his own preferences and work specifics.

The full settings dialog is opened either from the keyboard using the Win + Alt + P combination or by calling the Settings item from the ConEmu system menu.

You can get lost in a heap of tabs and settings, but all settings are grouped by meaning, and for non-obvious options, tooltips are displayed when you hover the mouse. Probably you should not tell in this article about each option, so let's go over only the main and most interesting ones.

Shell selection


, , , .



«Startup». — : «Command line» , :

C:\MinGW\msys\1.0\bin\sh.exe --login -i

, cmd, python, .. GUI PuTTY, notepad, gvim ..

— «Tasks» () . , « ».

>C:\MinGW\msys\1.0\bin\sh.exe --login -i
cmd /k set ConEmuHooks=OFF & "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" -new_console:sV -new_console:t:SDK & set ConEmuHooks=
cmd -new_console:s1TH
*powershell -new_console:s2TH -new_console:t:PowerShell



«Shells», «Startup» «Specified named task».

ConEmu 4 2x2 sh.exe, powershell.exe ( UAC) «PowerShell».

"-new_console" , ConEmu . , .


(toolbar) [+] . , . «split», . «Run as administrator» . «New window» ConEmu.exe .



[+] «» . Win+N. . – .



ConEmu. , Far Manager ( Far ConEmu C:\Far)

"C:\Far\ConEmu.exe" /single /cmd "C:\Far\Far.exe"

(Jump List) Windows 7. , .

. ( ) (Win+N ) – . «Keys & Macro» (Win+Alt+K), «Macro NN» «GUI Macro» - :

shell("",@"C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe")

: C-string \r\n\t\a\e\"\\, Verbatim-string @"app.exe ""C:\My Documents\File.txt""".



, ConEmu -new_console. , , , « », (split-screen).

cmd /c dir /s c:\ -new_console:bc

cmd-, ConEmu

csudo dism.exe /online /enable-feature /featurename:NetFX3 /All /Source:D:\sources\sxs /LimitAccess

( Shift+ ) «Duplicate root». . cmd , «Duplicate root» , , .

Ctrl+Shift+O Ctrl+Shift+E, , (split-screen).

,


«Mark & Paste» «Controls» . .

:

«Text selection»: Shift+, Shift+ Shift (drag ).

«Block selection»: Shift+, Shift+ Alt (drag ).

: Far Manager Shift+ Far ConEmu.

: Ctrl+C Enter. Esc .

.


Ctrl+V . ? , , .

Shift+Ins .


Ctrl+Shift+D Ctrl+Shift+F Windows- .


ConEmu . Ctrl+BackSpace .


ConEmu (ShellExecute) . Ctrl www... test.c(50): error: ....


«Main». : , , (Clear Type, Standard, None). , – «Monospace».

, ConEmu . ( fon, ttf, otf, bdf) ConEmu . «Main». – . «» «Features» «Auto register fonts».

( Far Manager ..) . .

. — Ctrl .

Quake/Tilda


ConEmu « ». «Main» «Quake style slide down». «Auto–hide on focus lose». – «Frame width» «0» "-1" ("-1" — ). ConEmu – «Center console in ConEmu workspace» «Pad size».

« » «Appearance» «Always on top».

ConEmu ? «Task bar» . Quake () TSA (taskbar status area – ), «Auto minimize to TSA». – «Don't show ConEmu window on Taskbar» «Always show TSA icon» ConEmu.

. ( ). «Keys & Macro» «Minimize/Restore» «Minimize/Restore (alternative)». ( Ctrl+~), , . , .

. , ConEmu Esc. «Task bar» «Minimize ConEmu by Esc» «Always». «Map Shift+Esc to Esc» - «Esc» .

() . ( , ), , resizable .

Windows 7


(Jump List). «Tasks» «Add ConEmu tasks to taskbar» «Update Now».



.




– . – «Replace color indexes». "*" – , , , - ( «Colors») "#2" "*". «Path» (bmp, jpg, png ), , «48 10 36» Ubuntu. – «Darkening».

Far Manager – Far. " FAR". ConEmu, «ConEmu Background». Far Manager «Plugins configuration» (Alt+Shift+F9 ), «ConEmu Background» «Enable plugin».


ConEmu , 7z–. 7z– 7zip WinRar. «Update» : ; TSA; ; proxy–; ..


«Colors» (Solarized, Standard VGA, PowerShell, xterm, .) . : «Schemes» «Save».

16 , ConEmu .

Extend foreground colors


ConEmu 16 . , - , (#12) 16..31. 16..31, (-) ( ).
.

TrueColor


16- Colorer Far Manager Colorer TrueMod. , SharedMemory . Bold/Italic/Underline .

Far 3.0 TrueColor (24 Bold/Italic/Underline) . , ?

«Colors» «TrueMod (24bit color) support». .

ANSI X3.64


*nix Escape- DOS ANSI.SYS. Windows , ANSI Windows, ANSICON.

ConEmu ANSI X3.64 . «Inject ConEmuHk» «ANSI X3.64» «Features». ConEmu ANSI .

ANSI . cmd.

ConEmu


«Transparency» ConEmu. . ConEmu «» .

, ( «» ). .


Far Manager ( Far ConEmu) . , (, , chkdsk, PowerShell, .)

«» .

, PID , , , Far Manager , .

cmd.exe – «:». ConEmu .

– .

. Ctrl+Tab Ctrl+Shift+Tab. «Recent mode» . «Lazy tab switch» Ctrl. Ctrl /.

, . Win+ ( «Install keyboard hooks» «Win+Number – activate console» «Controls»). Win+1 , Win+2 – .. 9 Win, «Win+2,4» 24- ( ?). / Far Manager Win+ ( «Host-Key+Number iterates Far windows»).

«Win» -, Ctrl+Shift Apps. «Keys & Macro» «Activate console by number». -.


. PID , , , CAPS/NUM/SCROLL, , .. .

ConEmu Here


«Integration» Windows Explorer ConEmu .

«ConEmu Here» «ConEmu Inside». (cmd, powershell, bash, SDK ..) «Command» «Menu item», ( WinXP) «Register». «Menu item».

«ConEmu Inside» «ConEmu Here» , Windows Explorer (Inside).

ConEmu . ConEmu , . :

ConEmu.exe /insidewnd 0x13A40 /cmd powershell.exe

Default terminal


ConEmu Windows, «Windows SDK Command Prompt», «ipconfig /all» Win+R, TotalCmd, Visual Studio – ConEmu.

: «Integration» , ConEmuHk.dll ( «explorer.exe|devenv.exe|totalcmd.exe») «Force ConEmu as default terminal» , , «Register on OS startup». CreateProcessA, CreateProcessW, WinExec ConEmu.

IDE style


. , ConEmu cmd- SDK nmake devenv.com.



"/single" «Task parameters» ConEmu ( ). "-new_console:c" «pause» cmd, .

( Error.log) TypeBuildErrors.cmd "%~dp0Errors.log" , — . Far Manager — Win+~ ( ).

App distinct


.
PowerShell .
( , ).

Keys & Macro


. – Win+Alt+K.
GuiMacro. Ctrl+D : print("exit\n").

Far Manager


Far . , Far ConEmu ( F11 «ConEmu»).



.


Debug


. .
, «Shell» ConEmu dll-. ProcessMonitor, — VC cl.exe link.exe -. ConEmu .


Win+A — ( ).

ConEmu (Taskbar status area).

. Far Manager Far ( , , .), — .

— Apps+F «Edit» «Find text». , (Freeze console).


«» Ctrl+Win+Alt+Space.


, ConEmu . «» ( 9999 «» ), xterm 256 colors, , , ..
, , . wiki, , WhatsNew.


http://conemu.imtqy.com.

Source: https://habr.com/ru/post/164687/


All Articles