Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Seamless Windows Terminal Integration

David Refoua edited this pageJun 2, 2024 ·31 revisions

Introduction

🖥Windows Terminal is a modern, feature-rich, productive terminal emulator for Windows by Microsoft. It comes pre-installed on Windows 11, and can also be installed on Windows 10.

Some of the features include multiple tabs, panes, Unicode and UTF-8 character support, a GPU-accelerated text rendering engine, and custom themes, styles, and configurations.

It has support for font ligatures, colorful emojis, and a cool blurred-behind background.

Here's a demo of Windows Terminal with Cmder:

Cmder on Windows Terminal

Note:

  • If you want to replicate the above screenshot with the exact settings, you can use thesettings.json file from here:📦 TerminalSettings.zip.

  • Also, you need to download the latestAgave-Regular.ttf font from here:📜agave.ttf

  • The default color palette in the above screenshot is🖌️ OneHalf Dark, which is included in the settings.json file and already set as default.

Alternatively, follow the instructions below to add Cmder as the shell profile:

 

Instructions

  1. If not already installed, locate the Windows Terminal from the Microsoft store and install it:download page
    👉 Note: Windows 11 comes with Windows Terminal already pre-installed.

  2. Follow the instructions inthis page to set up the%CMDER_ROOT% environmental variable.
    ✍ Tip: If you already have a working environment variable, skip this step.

  3. OpenWindows Terminal, then press ⌨️Ctrl +, (Control-Comma) to open the Settings file ⚙️ (settings.json).
    If you see the GUI settings page, from the left side click on the ⚙ icon at the bottom of the sidebar.

    The settings file will be opened in your default text editor program for editing.

  4. Navigate toprofiles section and add the following profile to thelist attribute. You can place it at the top if you want Cmder to be the first item in the dropdown selection window.

    {"guid":"{00000000-0000-0000-ba54-000000000132}","commandline":"cmd.exe /k \"%cmder_root%/vendor/init.bat\"","icon":"%cmder_root%/icons/cmder.ico","name":"Cmder",// You can give a custom name here"closeOnExit":"graceful","hidden":false},

    👉 Note: Make sure todefine the environment variable before using the%CMDER_ROOT% portion.

  5. Additional configuration

    • You can makeCmder the default shell-environment/profile by changing thedefaultProfile attribute in the settings file to the name of Cmder's profile (i.e.cmder) in the settings file. For example, if thename of the Cmder profile iscmder, changedefaultProfile value to:

      "defaultProfile":"cmder",

     

    • You can specify a starting directory. The default starting directory isC:\Users\username\, i.e. the home directory. You can set it to anything you want by making the following changes:

      {"guid":"{00000000-0000-0000-ba54-000000000132}","commandline":"cmd.exe /k \"%cmder_root%/vendor/init.bat\"","startingDirectory":"E:/Codes/",// Specify your directory of choice"name":"Cmder","icon":"%cmder_root%/icons/cmder.ico","hidden":false},

     

    • You can also add theMonokai-Cmder color scheme into Terminal's"schemes": []
      (source:https://atomcorp.github.io/themes/?theme=Monokai+Cmder)

      {"name":"Monokai Cmder","black":"#272822","red":"#a70334","green":"#74aa04","yellow":"#b6b649","blue":"#01549e","purple":"#89569c","cyan":"#1a83a6","white":"#cacaca","brightBlack":"#7c7c7c","brightRed":"#f3044b","brightGreen":"#8dd006","brightYellow":"#cccc81","brightBlue":"#0383f5","brightPurple":"#a87db8","brightCyan":"#58c2e5","brightWhite":"#ffffff","background":"#272822","foreground":"#cacaca","selectionBackground":"#cccc81","cursorColor":"#ffffff"},

      After that, modify the Cmder profile with"colorScheme": "Monokai Cmder", like this:

      {"guid":"{00000000-0000-0000-ba54-000000000132}","commandline":"cmd.exe /k \"%cmder_root%/vendor/init.bat\"","colorScheme":"Monokai Cmder",// Set the color scheme to "Monokai Cmder""icon":"%cmder_root%/icons/cmder.ico","name":"Cmder","closeOnExit":"graceful","hidden":false},

      Monokai Cmder on Windows Terminal

     

    • To use Powershell instead of the default clink shell, use the following values:

      {"guid":"{00000000-0000-0000-ba54-000000000127}","name":"Cmder :: Powershell","commandline":"%SystemRoot%/System32/WindowsPowerShell/v1.0/powershell.exe -ExecutionPolicy Bypass -NoLogo -NoProfile -NoExit -Command \"Invoke-Expression '. ''%cmder_root%/vendor/profile.ps1'''\"","icon":"%cmder_root%/icons/cmder.ico","colorScheme":"Monokai Cmder","hidden":false},
  6. Configure the prompt colors: In order to change the prompt colors, modify the following file:

    %cmder_root%\config\cmder_prompt_config.lua
    uah_color="\x1b[1;33;49m"-- Green = uah = [user]@[hostname]cwd_color="\x1b[1;32;49m"-- Yellow cwd = Current Working Directorylamb_color="\x1b[1;30;49m"-- Light Grey = Lambda Colorclean_color="\x1b[1;37;49m"dirty_color="\x1b[33;3m"conflict_color="\x1b[31;1m"unknown_color="\x1b[37;1m"-- White = No VCS Status Branch Color

    For more customizations, please seeCustomization.

    👉 Note: The previous default prompt colors might produce an ugly black background in your acrylic theme, such as below:
    This was due to use ofSGR40 color code instead ofSGR49 as in the provided config above. Using the values provided above willfix the issue.

Optional Steps

Default terminal application

If you're onWindows 11, you can setMicrosoft Terminal as the default Terminal app on windows, so even if you typecmd.exe in the run menu, the new terminal app will open instead (reference).

Then, together with theDefault profile option set to Cmder, you can get the option to launchCmder instead of Command Prompt in a more modern and safe way.

  1. PressCtrl +, (Control-Comma) to accessTerminal Settings
  2. Set theDefault terminal application toWindows Terminal
  3. ClickSave

With this mechanism, you can take use of theWin +X keys to open the terminal quickly.

Atom OneDark Scheme

You can set the default profile values to have a better-looking color scheme, such asOneHalfDark and optionally with theagave monospace font:

"defaults":        {"closeOnExit":"never","colorScheme":"OneHalfDark","cursorColor":"#FFFFFF","cursorShape":"vintage","font":            {"face":"agave","size":12            },"historySize":9001,"opacity":90,"padding":"4, 4, 4, 4","snapOnInput":true,"startingDirectory":"%USERPROFILE%","useAcrylic":true        },
        {"background":"#282C34","black":"#5A6374","blue":"#61AFEF","brightBlack":"#5A6374","brightBlue":"#61AFEF","brightCyan":"#56B6C2","brightGreen":"#98C379","brightPurple":"#C678DD","brightRed":"#E06C75","brightWhite":"#DCDFE4","brightYellow":"#E5C07B","cursorColor":"#FFFFFF","cyan":"#56B6C2","foreground":"#DCDFE4","green":"#98C379","name":"OneHalfDark","purple":"#C678DD","red":"#E06C75","selectionBackground":"#FFFFFF","white":"#DCDFE4","yellow":"#E5C07B"        },

This guide was developed initially from issue#2121

More information:

Demo

Windows Terminal Cmder

Default Cmder (with ConEmu)

Clone this wiki locally

[8]ページ先頭

©2009-2025 Movatter.jp