clink: 讓Windows Cmd擁有readline能力


用慣了Linux下的bash,在Windows下對於那個cmd.exe很惱火,且不說雙引號區分參數這樣的“高級”問題,就是調個歷史命令都麻煩得很,命令行編輯能力相當弱。

最近發現了clink這個擴展,可以讓cmd.exe擁有幾乎readline的全部能力。

clink: Bringing Bash's powerful command line editing to Microsoft Windows' cmd.exe

http://code.google.com/p/clink/

  • Powerful Bash-like line editing from GNU's Readline library. Read more on Readline's keyboard shortcuts.
  • Superior path completion (TAB).
  • Paste from clipboard (Ctrl-V).
  • Support for the completion of executables/commands, and environment variables.
  • Undo/Redo (Ctrl-_ or Ctrl-X, Ctrl-U)
  • Improved command line history.
    • Persists across sessions.
    • Searchable (Ctrl-R and Ctrl-S).
    • History expansion (e.g. !!, !<string>, and !$).
  • Scriptable completion using Lua.

 

跟隨cmd自動啟動clink

clink的安裝程序帶有“Autorun when cmd.exe starts"選項,但如果你不想使用安裝程序,又想要在啟動cmd時自動啟動clink,可以按如下辦法:

  1. 打開注冊表編輯器,找到(或者新建)HKEY_CURRENT_USER\Software\Microsoft\Command Processor
  2. 在該鍵下新建一個字符串項,名為AutoRun
  3. 將AutoRun的值設置為一個bat文件的路徑,比如d:\cmdstart.cmd
  4. 編輯d:\cmdstart.cmd,里面寫一句 d:\tools\clink /inject (當然你也可以再添加其他命令)

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM