clink

Bash's powerful command line editing in cmd.exe

GPL-3.0 License

Stars
3.5K
clink - v1.1.21

Published by chrisant996 almost 4 years ago

This is a release candidate build.

This release candidate build seems to be working very well for me, even when copied into an existing Cmder\vendor\clink directory. Be sure to make a backup copy of your Cmder installation before copying Clink into an existing Cmder installation!

Highlights for v1.1.21:

  • Added clink.oninject() so scripts can register a callback function to run when Clink is injected into CMD.
  • Added console.linehascolor() function that returns whether the specified line contains any of the specified colors.
  • Added console.findprevline() and console.findnextline() functions that can search backwards or forwards for text and/or colors in the screen buffer. Regular expressions may be used.
  • Fixed doskey alias parsing for match generators and input line coloring (Clink had been using slightly different parsing rules than CMD does).
  • Fixed the "-- More --" prompt while listing key bindings; Esc didn't quit, and unexpected keys weren't ignored.
clink - v1.1.20

Published by chrisant996 almost 4 years ago

This is a release candidate build.

This release candidate build seems to be working very well for me, even when copied into an existing Cmder\vendor\clink directory. Be sure to make a backup copy of your Cmder installation before copying Clink into an existing Cmder installation!

Highlights for v1.1.20:

  • Now you can bind Lua functions to keys! Added new rl_buffer type that gets passed to the Lua function.
  • Added a group of console Lua APIs intended mainly for use by Lua function key bindings (e.g. console.scroll()).
  • Added string.equalsi() function that performs a case insensitive UTF8 comparison of two strings.
  • Added string.matchlen() function that compares two UTF8 strings and returns how many characters match at the beginning, or -1 if the entire strings match. It respects the match.ignore_case and match.ignore_accents settings.
  • Added path.toparent() function that adjust the input string by moving up one directory level.
  • Added clink.onendedit() so scripts can register a callback function to run when editing finishes (e.g. Enter is pressed). If desired, the function can even change the input text. This is very powerful, and should be used carefully.
  • Changed os.getbatterystatus() to return a table with the battery status details, rather than four separate return values.
  • Fixed the doskey.enhanced setting to not expand doskey aliases when preceded by a space. However, a doskey alias after a & or | command separator needs to be preceded by two spaces to avoid expanding it. That's so alias & alias expands both, and alias & alias expands neither; while the rules are more complicated to explain, they make more sense visually.
  • Fixed environment variable completion (regression introduced in v1.1.19).
  • Fixed Cmder startup (regression introduced in v1.1.17). Cmder expects to be able to replace Clink v0.4.9's clink.lua file, but there is no such thing anymore in newer versions of Clink. To be properly backwardly compatible with Clink v0.4.9 requires loading clink.lua (if it exists) from the first script directory listed by clink info, and ignoring clink.lua files in all other script directories.
clink - v1.1.19

Published by chrisant996 almost 4 years ago

This is a release candidate build.

This release candidate build seems to be working very well for me, even when copied into an existing Cmder\vendor\clink directory. Be sure to make a backup copy of your Cmder installation before copying Clink into an existing Cmder installation!

Highlights for v1.1.19:

  • Improved responsiveness while typing: matches are collected only on demand, instead of always while typing. This makes it possible to always support match completion for UNC paths.
  • Fixed #50 Alt+H could warn about likely mistakes in key bindings.
clink - v1.1.18

Published by chrisant996 almost 4 years ago

This is a release candidate build.

This release candidate build seems to be working very well for me, even when copied into an existing Cmder\vendor\clink directory. Be sure to make a backup copy of your Cmder installation before copying Clink into an existing Cmder installation!

Highlights for v1.1.18:

  • The input text now has context sensitive coloring based on the argmatchers. It's on by default and can be turned off with clink set clink.colorize_input false.
  • Updated the Readline library to 8.1.
  • Terminal emulation now supports the audible bell character.
  • Fixed #48 menu-complete gets stuck.
  • Fixed #47 Alt+D erases history instead of word.
  • Fixed #46 typing .. in subdirectory of root doesn't work.
  • Fixed restoring color after pager when showing help.
  • Fixed clink set match completions for color settings.
clink - v1.1.17

Published by chrisant996 almost 4 years ago

This is a release candidate build.

This release candidate build seems to be working very well for me, even when copied into an existing Cmder\vendor\clink directory. Be sure to make a backup copy of your Cmder installation before copying Clink into an existing Cmder installation!

Highlights for v1.1.17:

  • Added os.getbatterystatus() function that gets battery status information much faster than launching wmic.
  • Fixed #44 Path completion doesn't work with cd /d.
clink - v1.1.16

Published by chrisant996 almost 4 years ago

This is a release candidate build; an official release build is likely to arrive before Jan 1.

This release candidate build seems to be working very well for me, even when copied into an existing Cmder\vendor\clink directory. Be sure to make a backup copy of your Cmder installation before copying Clink into an existing Cmder installation!

Highlights for v1.1.16:

  • Added match.ignore_accent setting (enabled by default) that ignores Latin alphabet diacriticals when completing matches (e.g. ä matches a, ı matches i, ł matches l, etc).
  • Fixed #42 history lines are split on special characters.
  • Fixed #41 Enable custom doskey handling of .. and -.
  • Fixed Readline bug inserting dir matches; \win_ foo (cursor at _) would become \Windows\\_ foo.
  • Fixed the quoted-insert command to insert just \x1b when ESC is pressed.
clink - v1.1.15

Published by chrisant996 almost 4 years ago

This is a release candidate build; an official release build is likely to arrive before Jan 1.

This release candidate build seems to be working very well for me, even when copied into an existing Cmder\vendor\clink directory. Be sure to make a backup copy of your Cmder installation before copying Clink into an existing Cmder installation!

Highlights for v1.1.15:

  • Migrating settings now immediately writes a new settings file, instead of waiting until a setting is changed.
  • Added support to detect when running in Windows Terminal and use native terminal support (which enables things like Xterm 256 and 24-bit color support).
  • Added terminal emulation support for Xterm 256 and 24-bit color escape codes. Clink maps the specified color to the most similar color in the active 16 color palette (using the CIELAB color space). To get full support for 24-bit color, it's necessary to use ConEmu or Windows Terminal or a similar console host, or to set terminal.emulation to native (which isn't supported on some older Windows OS versions).
  • Allow doskey macros named .. or -, and also now doskey macros that resolve to .. or - or a directory name will work (just like if the macro text had been typed at the Clink prompt).
  • Fixed compatibility problem with various scripts getting the %HOME% environment variable. Now if it isn't set, then Clink synthesizes %HOME% from %HOMEDRIVE% and %HOMEPATH% or from %USERPROFILE%.
  • Fixed saving color settings to behave like other settings: only write a setting's value to the setting file if it differs from the default value.
  • Fixed the clink.print() Lua function so it also works during loading scripts and during prompt filtering.
  • Fixed the Readline input text display getting garbled if the filtered prompt includes Xterm's OSC window title code (\x1b]0;text\x07). Clink doesn't support that escape code, but at no longer garbles the input text if that escape code is present.
clink - v1.1.14

Published by chrisant996 almost 4 years ago

This is a release candidate build; an official release build is likely to arrive before Jan 1.

This release candidate build seems to be working very well for me, even when copied into an existing Cmder\vendor\clink directory. Be sure to make a backup copy of your Cmder installation before copying Clink into an existing Cmder installation!

Highlights for v1.1.14:

  • Migrate settings and history from an old version of Clink, if present. This only happens if the new-version Clink settings or history files don't exist. (Deleting an existing new-version Clink settings or history file will cause migration to happen again.)
  • Added color.prompt setting for backward compatibility with Clink v0.4.x.
clink - v1.1.13

Published by chrisant996 almost 4 years ago

This is a release candidate build; an official release build is likely to arrive before Jan 1.

This release candidate build seems to be working very well for me, even when copied into an existing Cmder\vendor\clink directory. Be sure to make a backup copy of your Cmder installation before copying Clink into an existing Cmder installation!

Highlights for v1.1.13:

  • Fixed clink.arg.register_parser backward compatibility.
clink - v1.1.12

Published by chrisant996 almost 4 years ago

This is a release candidate build.
An official release build is likely to arrive before Jan 1.

This is a release candidate build, and seems to be working very well for me, even when copied into an existing Cmder\vendor\clink directory. Be sure to make a backup copy of your Cmder installation before copying Clink into an existing Cmder installation!

Highlights for v1.1.12:

  • Added clink.ondisplaymatches() as a replacement for the deprecated clink.match_display_filter. The new API is able to support popup list windows as well.
  • Speculative possible fix for #35 Crash when clink on clink.bat.
  • Fixed #33 Tab autocomplete, auto-quoting paths doesn't seem to work as in Clink 0.4.9.
clink - v1.1.11

Published by chrisant996 almost 4 years ago

This is a release candidate build.
An official release build is likely to arrive before Christmas this year.

All of the features planned for the first official release from this fork have been completed, and backward compatibility with v0.4.8 seems to be working well.

This is a release candidate build, and seems to be working very well for me, even when copied into an existing Cmder\vendor\clink directory. Be sure to make a backup copy of your Cmder installation before copying Clink into an existing Cmder installation!

Highlights for v1.1.11:

  • Changed to load Lua scripts only once per session, unless forced to reload them. This enables backward compatibility for things like z.lua which has certain features that rely on Clink only loading scripts once per session.
  • Added clink.onbeginedit() so scripts can register a callback function to be called each time the edit prompt is activated.
  • Added lua.reload_scripts setting to optionally force reloading Lua scripts each time the edit prompt is activated.
  • Added color.message setting for the Readline message area color (e.g. the search prompt message or digit argument prompt message, etc).
  • Fixed stray sticky = appended to completions after typing set and then typing a different command.
clink - v1.1.10

Published by chrisant996 almost 4 years ago

This is a release candidate build.
An official release build is likely to arrive before Christmas this year.

All of the features planned for the first official release from this fork have been completed, and backward compatibility with v0.4.8 seems to be working well.

This is a release candidate build, and seems to be working very well for me, even when copied into an existing Cmder\vendor\clink directory. Be sure to make a backup copy of your Cmder installation before copying v1.1.10 into an existing Cmder installation!

Highlights for v1.1.10:

  • Fixed #32 hooking ReadConsoleW on Windows 7.
clink - v1.1.9

Published by chrisant996 almost 4 years ago

This is a release candidate build.
An official release build is likely to arrive before Christmas this year.

All of the features planned for the first official release from this fork have been completed, and backward compatibility with v0.4.8 seems to be working well.

This is a release candidate build, and seems to be working very well for me, even when copied into an existing Cmder\vendor\clink directory. Be sure to make a backup copy of your Cmder installation before copying v1.1.9 into an existing Cmder installation!

Highlights for v1.1.9:

  • Added backward compatibility for clink.match_display_filter. The clink-completions/git.lua script uses it a lot, and that should all be working now.
  • settings.add adds a color setting when the type is string and the name starts with "color.".
  • settings.get now has an extra parameter to request the user friendly color name when getting a color setting.
  • Added clink.version_encoded variable with the Clink version number as MMmmmpppp (e.g. v1.1.9 is 10010009) to make it easy for scripts to check for feature availability.
  • The clink info command now shows Lua script paths as well.
  • Fixed backward compatibility for loading scripts from the profile directory (if clink.path isn't set, then load scripts from the DLL directory and the profile directory).
  • Fixed some color.input bleed through to other things (introduced in v1.1.5).
  • Fixed scroll commands (regression introduced by input line color in v1.1.5).
  • Fixed horizontally sorted match display and re-enabled the performance fix from v1.1.4.
  • Fixed wildcard evaluation with non-file and non-directory matches (e.g. a branch name origin/master accidentally didn't match or or *ma because of the /).
  • Fixed sort order of foo\ vs foo.bar\ when displaying matches or using the menu-complete family of commands.
  • Fixed potentially-missing trailing path separator when menu-complete completes a directory match (regression introduced by wildcard matching in v1.1.5).
  • Other obscure minor fixes.
clink - v1.1.8

Published by chrisant996 almost 4 years ago

This is a release candidate build.
An official release build is likely to arrive before Christmas this year.

All of the features planned for the first official release from this fork have been completed, and backward compatibility with v0.4.8 seems to be working well.

This is a release candidate build, and seems to be working very well for me, even when copied into an existing Cmder\vendor\clink directory. Be sure to make a backup copy of your Cmder installation before copying v1.1.8 into an existing Cmder installation!

Highlights for v1.1.8:

  • Fixed file match completions when an argmatcher only generates flag matches.
  • Fixed automatic inferring whether Readline should use filename completion and/or display rules.
  • Fixed backward compatibility for clink.find_files() and clink.find_dirs().
    • Ignore extra arguments after the first one (the performance improvement in v1.1.7 revealed that some scripts call clink.find_files() with extra invalid arguments; e.g. clink-completions/modules/matchers.lua).
    • Don't append a trailing path separator on directory names returned by these functions (the new os.globfiles() and os.globdirs() functions do, but the old clink.find_files() and clink.find_dirs() functions should not).
  • Fixed backward compatibility for coloring matches.
clink - v1.1.7

Published by chrisant996 almost 4 years ago

This should be a pretty solid Beta build.
An official release build is likely to arrive before Christmas this year.

All of the features planned for the first official release from this fork have been completed, and backward compatibility with v0.4.8 seems to be working well.

This is a Beta build, and seems to be working very well for me, even when copied into an existing Cmder\vendor\clink directory. Be sure to make a backup copy of your Cmder installation before copying v1.1.7 into an existing Cmder installation!

Highlights for v1.1.7:

  • Performance improvement when displaying matches: When enumerating files and dirs, the os.globfiles and os.globdirs functions have all the info about each file. Now they can return that info in a table. This frees the match display function from needing to do any further file system IO. The performance boost is noticeable.
  • Rewrote the color settings: the .fg and .bg sub-settings are gone, and the main setting now uses a more natural syntax (e.g. clink set color.input bright yellow or clink set color.modmark bright cyan on blue).
  • Added "cmd" match type for shell (CMD.EXE) command completions.
  • Added VT emulation for the reverse video SGR parameters.
  • Fixed tab completion for clink set <setting>, and also handle the new color setting syntax.
  • Fixed confusing behavior if multiple scripts try to add settings with the same name (now the first one succeeds and the rest report errors).
clink - v1.1.6

Published by chrisant996 almost 4 years ago

This should be a pretty solid Beta build.
An official release build is likely to arrive before Christmas this year.

All of the features planned for the first official release from this fork have been completed, and backward compatibility with v0.4.8 seems to be working well.

This is a Beta build, and seems to be working very well for me, even when copied into an existing Cmder\vendor\clink directory. Be sure to make a backup copy of your Cmder installation before copying v1.1.6 into an existing Cmder installation!

Highlights for v1.1.6:

  • Hooked up tilde completion in the cd, md, and rd command argmatchers.
  • Hooked up tilde completion with the exec.enable setting ("~\pro" matches "C:\Users\<myusername>\program.exe").
clink - v1.1.5

Published by chrisant996 almost 4 years ago

This should be a pretty solid Beta build.
An official release build is likely to arrive before Christmas this year.

All of the features planned for the first official release from this fork have been completed, and backward compatibility with v0.4.8 seems to be working well.

This is a Beta build, and seems to be working very well for me, even when copied into an existing Cmder\vendor\clink directory. Be sure to make a backup copy of your Cmder installation before copying v1.1.5 into an existing Cmder installation!

Highlights for v1.1.5:

  • The menu-complete family of commands now support matching ? and * wildcards when the match.wild setting is enabled.
  • Added colour.input and colour.modmark settings for coloring Readline's input line.
  • Added clink.upper() Lua function, and both clink.lower() and clink.upper() are properly UTF8 aware now.
  • Added clink-copy-word command that copies the word at the cursor to the clipboard.
  • Added clink.promptfilter setting to control whether to filter the prompt with Lua scripts.
  • Renamed terminal.emulate setting to terminal.emulation.
  • Improved executable file extension logic to consistently use %PATHEXT% (and efficiently).
  • Changed colour.hidden setting to not be set by default.
  • Fixed #28 Tab completion for "~" does not work.
  • Fixed #25 Unicode surrogate pairs (and emoji) input isn't working -- Microsoft Terminal renders the text correctly, but ConEmu and the default conhost still don't (and that isn't a Clink issue).
  • Fixed screen size bug in Readline on Windows.
  • Fixed the backwards values in the terminal.emulation setting.
  • Fixed .... so it works properly again.
  • Fixed case sensitive sorting of matches.
  • Fixed the exec.cwd Clink setting to default to true, so that the default behavior is consistent with how v0.4.x behaved.
  • Various other fixes; see CHANGES for more info.
clink - v1.1.4

Published by chrisant996 almost 4 years ago

Highlights:

  • v1.1.4 has broad backward compatibility for v0.4.x scripts.
  • Automatically detects when running inside ConEmu and disables Clink's Virtual Terminal emulation so that ConEmu gets to handle ANSI escape codes.
  • Suppresses adding a space after completing a flag match that ends with : or = (e.g. msbuild -maxCpuCount:).
  • Reports any errors while loading Lua scripts (previously it reported errors while running scripts, but not while loading them).
  • Fixed slow printing of possible matches.
  • Various other fixes; see CHANGES for more info.

This is a Beta build, and seems to be working very well for me, even when copied into an existing Cmder\vendor\clink directory. Be sure to make a backup copy of your Cmder installation before copying v1.1.4 into an existing Cmder installation!

clink - v1.1.3 Alpha

Published by chrisant996 almost 4 years ago

  • Fixed argmatcher lookup to be more strict, like in Clink 0.4.9 (match exact names, or name plus an extension from %PATHEXT%).
  • Backward compatibility:
    • Most things should work now.
    • Dropping the new Clink on top of the vendor\clink directory in Cmder seems to work -- but make a backup before you try this at home!
  • API changes:
    • Added log.info() function.
    • Added Clink version numbers in clink.version_major, etc.
    • Added _argmatcher:getwordbreakinfo() callback; removed _argmatcher:setprefixincluded() (it was a mess, and it was new to v1.x, so there's no compatibility concern with removing it).
    • Deprecated _argmatcher:setflagprefix(); now it happens automagically when using _argmatcher:addflags().
    • Introduced several deprecated functions to support backward compatibility.
  • Improvements to Lua debugger:
    • Added lua.traceback_on_error, lua.break_on_error, and lua.break_on_traceback settings to make debugging script errors easier.
    • Made pause() consistent about pausing in the caller (rather than sometimes inside the pause command itself).
    • The debugger automatically shows the stack trace when entering debug mode, and on every pause.
    • Show 3 lines of source context by default.
    • The help list is sorted now.
    • Fixed the set command in the debugger to behave as documented.
clink - v1.1.2 Alpha

Published by chrisant996 almost 4 years ago

This is the second alpha test version of clink from the chrisant996 fork.

I use it full time now. It should work well, with some caveats:

  • Don't use it to replace cmder's vendor clink. Lua script changes aren't fully compatible between v0.4.9 included with cmder versus this v1.1.2 version.
  • Lua scripts from v0.4.8 may or may not fully work with v1.1.2.
    • Prompt filtering and some simple argmatchers should work.
    • More sophisticated match generators won't be compatible; you'll need to edit them by hand.
    • Fortunately it's pretty easy to do! Unfortunately the related documentation is still not done.
  • This is an alpha version and likely has bugs.
  • See the issues page to view or report issues.

See the CHANGES file for more information about what's in this release.
The documentation is here, and is mostly updated.