惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

J
Java Code Geeks
小众软件
小众软件
博客园 - 叶小钗
宝玉的分享
宝玉的分享
博客园_首页
Hugging Face - Blog
Hugging Face - Blog
人人都是产品经理
人人都是产品经理
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
S
SegmentFault 最新的问题
B
Blog RSS Feed
Engineering at Meta
Engineering at Meta
N
Netflix TechBlog - Medium
Google DeepMind News
Google DeepMind News
U
Unit 42
F
Fortinet All Blogs
IT之家
IT之家
Y
Y Combinator Blog
Martin Fowler
Martin Fowler
T
The Blog of Author Tim Ferriss
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
The GitHub Blog
The GitHub Blog
Stack Overflow Blog
Stack Overflow Blog
Blog — PlanetScale
Blog — PlanetScale
酷 壳 – CoolShell
酷 壳 – CoolShell

jdhao's digital space

Conversion between base64 and OpenCV or PIL Image 腾讯云对象存储博客图床开启 CDN 加速(不需要购买额外域名) Search and Replace in Multiple Files in Vim/Neovim Change Table Column Width in LaTeX Image or Table Side by Side in LaTeX LaTeX 并排显示图像或表格 Firenvim: Neovim inside Your Browser Content inside HTML tags missing in Latest Hugo? Creating Markdown Front Matter with Ultisnips Labelme JSON 标注格式转 voc XML 格式 Nifty Nvim Techniques That Make My Life Easier -- Series 6 macOS 下如何为视频制作字幕 Running Command Asynchronously inside Neovim Resolving Merge Conflict after Git Stash Pop Pylint: command not found? A Hands-on Experience with Neovim's Built-in LSP Support How to Convert PDF to Images with Imagemagick 互联网上常用缩略语集锦 File Backup in Neovim Converting PDF Pages to Images with Poppler Nifty Nvim Techniques That Make My Life Easier -- Series 5 Neovim Configuration for System-wide Use How to sort a list of tuple or list in Python -- lambda or itemgetter? Building A Vim Statusline from Scratch 人类第一颗原子弹爆炸始末 Distributed Training in PyTorch with Horovod Learning Expect Programming Essential Knowledge about SSH Nifty LaTeX Techniques -- Series 1 更改 Adsense 邮寄地址,重新寄送 PIN
Cmder --- The Ultimate Command Line Tool for Windows
2017-12-29 · via jdhao's digital space

Intro to Cmder#

As a Windows user, now and then, I have to use the Windows CMD to run some simple command. Compared to its Linux counterpart (bash, for example), the Windows CMD is totally disaster: it does not support smart TAB completion, it does not support pipes and it has a dumb UI… Fortunately, there is a tool called cmder which tries to enhance our experience of using consoles on Windows systems. It has a decent UI with different color themes, support for Linux-style tab completion and more… It is far better than windows CMD.

Installation#

Cmder is a combination of several good tools: Conemu, clink and git for Windows. In order to use its full functionality, it is better to install the full version. After download, just extract the zip package into your program folder. Then you can launch cmder using launch tools such as Listary.

How to Use#

Start cmder in a particular directory#

Sometimes, we want to start cmder in current directory. We can configure this easily:

  1. Open the cmder executable as an Administrator
  2. Go the directory where cmder is extracted, e.g., D:\Program Files\cmder
  3. Execute .\cmder.exe /REGISTER ALL command

Then go to a directory and right click, you will see a contextual menu option Cmder Here (See image below).

keyboard shortcut#

ShortcutDescription
Ctrl+T or Ctrl+Shift+1start a new console tab
Ctrl+Wclose a console tab
Ctrl+Rsearch command history
Win+Alt+Popen settings page

Fore more keyboard shortcut, see here.

UTF-8 decoding related issue#

In order to show Chinese characters properly, we need to set up console to use UTF-8 decoding. Also, the font used should support Chinese characters. First we need to set up the font options, as shown below:

Show directories with Chinese characters in their names#

In its default setting, cmder can not display directories with Chinese characters in their names as shown below.

This can be easily fixed. Open the setting page, and go to Startup -> Environment, in the text box, use the following setting:

Error message containing Chinese characters#

When we are executing some command, the error message from the command may contains Chinese characters, which are not displayed properly:

$ pandoc –pdf-engine=xelatex -V CJKmainfont=KaiTi test.md -o test.pdf Error producing PDF. ! Undefined control sequence. l.67 …锟斤拷搴︽湁闂锛屽簲璇ユ妸\textwidth鎹㈡垚

This can be fixed by adding chcp utf-8 or chcp 65001 in the environment settings (see the above setting image). After applying this change, restart cmder and rerun the command, we find that the error message is correctly displayed now:

$ pandoc –pdf-engine=xelatex -V CJKmainfont=KaiTi test.md -o test.pdf Error producing PDF. ! Undefined control sequence. l.67 …��度有问题,应该把\textwidth换成

Spurious character is inserted in command prompt when we press up arrow#

When we press up arrow “↑” to bring up the history command, then delete the command, we may find that spurious character is inserted at command prompt. This issue is explained more thoroughly here, here and here.

In order to fix it, go to the cmder installation folder, the edit the file vendor\clink.lua.

For older versions of Cmder#

Replace the following snippet

if env == nil then
    lambda = "λ"
else
    lambda = "("..env..") λ"
end

with

if env == nil then
    lambda = "$"
else
    lambda = "("..env..") $"
end

For latest versions of Cmder#

For the latest version of cmder (version 1.3.8), it seems that this old issue still persists. The clink.lua file have changed. Find the line

and replace it with

Restart cmder and the problem should disappear.

References#