clink

Bash's powerful command line editing in cmd.exe

GPL-3.0 License

Stars
3.5K
clink - v1.6.21 Latest Release

Published by chrisant996 2 months ago

  • Reduced the performance overhead of hooked APIs from about 20 microseconds to about 2 microseconds.
  • Enhanced the executable recognition to avoid flickering red (or color.unrecognized) for an executable name that was already recognized in a recent previous input line.
  • Enhanced the srcmap command in the Lua debugger so that srcmap dir automatically sets up source mappings for Clink's built in scripts using dir as the repo root.
  • Fixed when history.expand_mode is off; it didn't fully turn off all of the history expansion syntax forms (for example the ^ syntax).
  • Fixed input line coloring when the first word is a device name (e.g. nul or com1:); it should use color.unrecognized for the color.
  • Fixed #651; completion doesn't work for ./ and ../ anymore in the first word of a command line. Now when the match.translate_slashes setting is system or backslash then completing ./ and ../ can complete the word as a path, even though CMD does not consider it to be a path.
  • Fixed #653; clink_start.cmd gets run twice if the binaries directory is the same as the profile directory.
  • Fixed #654; input line coloring doesn't treat ^ correctly inside quotes (and related quirks).
clink - v1.6.20

Published by chrisant996 3 months ago

v1.6.19 has been deleted because it accidentally broke the updater -- if you already updated to v1.6.19, then a one-time manual update to v1.6.20 or newer is necessary to restore the updater.

  • Fixed truncated descriptions with clink set exec. and then clink-select-complete (Ctrl-Space) (regression introduced in v1.6.11).
  • Fixed fully qualified paths from a different local drive accidentally being colored with color.unrecognized.
  • Fixed #648; on Windows 8.1 the title bar can get changed to "Windows PowerShell" for the rest of the CMD session.
  • Fixed #652; error when trying to update again after updating to v1.6.20 (regression introduced in v1.6.19).
clink - v1.6.19

Published by chrisant996 3 months ago

  • Fixed truncated descriptions with clink set exec. and then clink-select-complete (Ctrl-Space).
  • Fixed fully qualified paths from a different local drive accidentally being colored with color.unrecognized.
  • Fixed #648; on Windows 8.1 the title bar can get changed to "Windows PowerShell" for the rest of the CMD session.
clink - v1.6.18

Published by chrisant996 3 months ago

  • Added a new callback function that can be assigned to an argument position in the table given to :addarg() via onalias= (see Responding to Arguments in Argmatchers for more information). The git argmatcher in the clink-completions repo uses this to support git aliases.
  • When a doskey alias doesn't include any $ tokens then CMD is guaranteed to ignore the rest of the command line after the alias, so now argmatcher parsing also ignores the rest of the command line and colors it using color.unexpected.
  • Suppress the ANSICON warning in the log file and diagnostics output on Windows 8.1. The performance problem in ANSICON exists, but apparently there isn't a better alternative before Windows 10.
clink - v1.6.17

Published by chrisant996 3 months ago

  • Added warning in the log file and in clink-diagnostics (Ctrl-X,Ctrl-Z) when ANSICON is detected on Windows 8.1 or greater (it's unnecessary, less functional, and greatly degrades performance).
  • Added language info in clink-diagnostics when the code page is not 1252 (for easier troubleshooting).
  • Fixed finding argmatchers registered with exact names (typing foo couldn't find an argmatcher registered as c:\dir\foo.exe because it accidentally looked for c:\dir\foo.EXE).
  • Fixed #631; script error after cmd when the current language is German.
clink - v1.6.16

Published by chrisant996 4 months ago

  • Added a workaround for how scoop tries to control app versions and updates (#615; scoop causes clink autorun install to use a wrong path).
  • Added an auto mode for the match.translate_slashes setting. This mode makes completion translate all slashes in the completed word to match whichever kind occurs first in the word, or to the system path separator if there are no slashes yet (e.g. when completing a directory name).
  • Changed the default to auto for the match.translate_slashes setting.
  • Updated the clink.slash_translation() function.
  • UNC share name completion works with forward slashes now (e.g. //localhost/).
  • Added a clink-toggle-slashes bindable command, bound by default to Ctrl-/. The command toggles between forward and backslashes in the word at the cursor point, or in the Nth word if a numeric argument is provided (e.g. by the Alt-Digit keys).
  • Fixed the off mode for the matches.translate_slashes setting (regression introduced in v1.1.23).
  • Fixed input line coloring of @ in for %a in (*) do @whatever.
  • Fixed crash in glob-list-expansions when used on an empty word (regression introduced in v1.3.36).
  • Fixed wildcard completions when match.wild is on and match.substring is off.
  • Fixed obscure edge case where match filtering with wildcards could potentially yield inaccurate results immediately after an auto-suggestion was offered.
clink - v1.6.15

Published by chrisant996 5 months ago

  • Fixed hiding internal script names in the clink-diagnostics output (regression introduced in v1.6.11).
  • Fixed #613; wrong input line coloring for cmd /c "command line".
clink - v1.6.14

Published by chrisant996 5 months ago

  • Fixed menu-complete to respect completion-auto-query-items.
  • Fixed missing line break before dump-macros, dump-variables, clink-dump-functions, and clink-dump-macros (regression introduced in v1.6.3).
  • Fixed rl.getbinding() to return clink-select-complete instead of clink-popup-complete (the latter is just an alias; the real command name is clink-select-complete).
clink - v1.6.13

Published by chrisant996 6 months ago

  • Popup lists can now be filtered.
    • Press F4 in a popup list to toggle the search mode between "find" and "filter".
    • The clink.popup_search_mode setting controls the default search mode.
    • The clink.popuplist() function can be told to start in a specific search mode.
  • Added os.findfiles() to allow getting files/directories one at a time (versus os.globfiles() which collects the entire set all at once into a table).
  • Added exec.associations setting to let Executable Completion include files with registered file associations as matches (e.g. launchable documents such as "*.pdf" files).
  • Fixed Ctrl-C in a popup list copying the wrong entry after having used Del to delete an entry.
  • Fixed input line coloring to use color.executable also for files included by the exec.path setting, if the files have registered file associations.
clink - v1.6.12

Published by chrisant996 6 months ago

  • Fixed #597; prompt shows leftover text sometimes (regression introduced in v1.6.10).
  • Fixed #596; it's easy to forget whether Enter in history list executes or inserts.
clink - v1.6.11

Published by chrisant996 7 months ago

  • Added os.setalias() for setting a doskey alias without needing to invoke the doskey.exe program.
  • Fixed a case where match descriptions could be displayed with incorrect padding and truncation (regression introduced in v1.6.6).
  • Lua debugging enhancements:
    • Changed the built-in embedded scripts to include debug info, which allows some Lua error messages to be more useful for troubleshooting.
    • Added srcmap command in the Lua debugger to override where to find source files.
clink - v1.6.10

Published by chrisant996 7 months ago

  • Added an optimization to further reduce flicker when re-drawing the prompt.
  • Added a user_data.shared_user_data table to allow linked argmatchers to share data with each other while an input line is being parsed (see Responding to Arguments in Argmatchers for details).
  • Fixed #579; popup lists could accidentally truncate text in the first column when there's only one column.
  • Fixed #576; setup exe doesn't remove old uninstall exe files.
  • Fixed #575; error when color.executable is set and color.unrecognized is not (regression introduced in v1.6.2).
clink - v1.6.9

Published by chrisant996 7 months ago

  • Fixed #574; prompt.spacing "eats" lines containing Unicode Surrogate Pairs such as for some nerdfont icons (Windows Terminal accidentally returns that such lines are empty).
  • Fixed #573; C# was unable to read Clink's version resource.
  • Fixed #555; security advisory CVE-2020-24370 for a Lua bug.
clink - v1.6.8

Published by chrisant996 8 months ago

v1.6.8

  • Fixed #571; error in clink.bat under some circumstances (regression introduced in v1.6.7).

v1.6.7

  • Recognize the little-known cmd /r as a synonym for cmd /c so that Clink can optimize and skip injecting into a cmd /r process.
  • Fixed displaying descriptions when they're left-justified (regression introduced in v1.6.6).
  • Fixed argmatcher:chaincommand("run") to not find argmatchers for builtin CMD command names (since CMD doesn't get invoked in that case, so it won't get interpreted as a CMD command).
  • Fixed argmatcher:chaincommand() to find an argmatcher for a builtin CMD command even if a directory exists with the same name (since CMD interprets that case as a CMD command).
  • Fixed argmatcher:chaincommand("cmd") so when exec.aliases is enabled it can include aliases as completions.
  • Fixed argmatcher:addarg({loopchars="+", etcetc}) so that -Q:+x still gets parsed into two input words -Q: and +x.
  • Fixed to parse foo^ bar as two words "foo" and "bar".
  • Fixed to recognize ^echo (etc) as a builtin CMD command name despite embedded ^ characters.
  • Fixed #570; fixed #569 more thoroughly, and cd /d cannot be used anywhere because it also requires command extensions.
clink - v1.6.7

Published by chrisant996 8 months ago

  • Recognize the little-known cmd /r as a synonym for cmd /c so that Clink can optimize and skip injecting into a cmd /r process.
  • Fixed displaying descriptions when they're left-justified (regression introduced in v1.6.6).
  • Fixed argmatcher:chaincommand("run") to not find argmatchers for builtin CMD command names (since CMD doesn't get invoked in that case, so it won't get interpreted as a CMD command).
  • Fixed argmatcher:chaincommand() to find an argmatcher for a builtin CMD command even if a directory exists with the same name (since CMD interprets that case as a CMD command).
  • Fixed argmatcher:chaincommand("cmd") so when exec.aliases is enabled it can include aliases as completions.
  • Fixed argmatcher:addarg({loopchars="+", etcetc}) so that -Q:+x still gets parsed into two input words -Q: and +x.
  • Fixed to parse foo^ bar as two words "foo" and "bar".
  • Fixed to recognize ^echo (etc) as a builtin CMD command name despite embedded ^ characters.
  • Fixed #570; fixed #569 more thoroughly, and cd /d cannot be used anywhere because it also requires command extensions.
clink - v1.6.6

Published by chrisant996 8 months ago

  • Added clink history --no-show-time to allow omitting history timestamps even when the history.time_stamp setting is show.
  • Fixed match display to not right justify descriptions when the screen isn't wide enough or when descriptions contain aligned columns (like clink set completions do since v1.6.3).
  • Fixed clink history when output is redirected; strip any escape codes that might be embedded in the time format.
  • Fixed #569; cmd /e:off causes syntax error in clink.bat script.
  • Fixed #567; clink history compact accidentally deletes all timestamps.
  • Fixed documentation error in Lua API Reference about "w" mode in io.open() and io.sopen() (the behavior was correct, but the documentation was inaccurate/unclear).
clink - v1.6.5

Published by chrisant996 8 months ago

  • Added all match fields in the table of matches passed to the clink.onfiltermatches() callback function.
  • Fixed stripping colors from strings (e.g. when displaying in popup lists); it didn't strip 8-bit and 24-bit colors correctly.

NOTE: This release includes changes that enable clink-gizmos's FZF integration to show nerd fonts file icons in completion lists. See the README file there for more info. It also requires using dirx.

clink - v1.6.4

Published by chrisant996 8 months ago

  • Added rl_buffer:hassuggestion() and rl_buffer:insertsuggestion() for direct access to inserting suggestions without invoking Readline commands.
  • Added clink.dirmatchesexact() and clink.filematchesexact() which are the same as the non-exact variants, except these don't append a * to the search pattern. For example, clink.filematchesexact("*.zip") can collect exactly "*.zip" file matches instead of "*.zip*".
  • Added OS version info to clink info.
  • Added UNC share name completion when using Executable Completion (the exec.enable setting).
  • Fixed completing input . or .. when the exec.enable setting is enabled.
  • Fixed applying colored-completion-prefix when match display filtering is active or a match has a custom display field.
  • Fixed the exec.path setting so it doesn't accidentally include directories if their names end with an executable extension such as .exe.
  • Fixed finding an argmatcher registered with a full path (e.g. c:\foo\bar.exe) when a full path is entered without a drive letter (e.g. enter \foo\bar.exe).
  • Fixed #562; clink autorun install strips quotes by mistake.
clink - v1.6.3

Published by chrisant996 9 months ago

  • Breaking Change: For the four Ctrl-- key combinations, Clink got the Shift key backwards and generated inaccurate input codes. And that broke the Readline/bash default key binding for undo (the Windows default key binding of Ctrl-z works fine). If your .inputrc file has bindings for any of the Ctrl-- key combinations then you can keep the keys working the same by updating the key bindings. You can even use the $if clink_version >= 1.6.3 syntax in your .inputrc file to make it define the key bindings differently in different versions of Clink.
    Key Combination Old Code New Code
    Ctrl-- "\C-_" or C-_ "\e[27;5;189~"
    Ctrl-Shift-- "\e[27;6;189~" "\C-_" or C-_
    Ctrl-Alt-- "\e\C-_" or "\M-\C-_" or M-C-_ or etc "\e[27;7;189~"
    Ctrl-Alt-Shift-- "\e[27;8;189~" "\e\C-_" or "\M-\C-_" or M-C-_ or etc
  • Completions for all clink set settings include the current value in the description field (e.g. type clink set Alt-= to see Clink settings and their current values).
  • Fixed to differentiate between undo and vi-undo commands again (they do the same thing, but are technically different commands).
  • Fixed execute-named-command to also accept Ctrl-- for undo (the emacs binding for undo).
  • Fixed redisplaying multi-line prompts after using completion during execute-named-command.
  • Fixed accidentally loading the history file twice on each prompt; now it loads once, as intended.
  • Fixed another double-free and potential crash in the Readline library; after navigating through history entries and then editing a history entry, pressing Ctrl-c or Ctrl-Break could cause a crash or memory corruption (regression exposed by changes in Readline 8.2).
  • Applied fixes for 6 Lua bugs, curated by @goodusername123 (thank you!) from Lua.org:
    • "Dead keys with nil values can stay in weak tables."
    • "Expression list with four or more expressions in a 'for' loop can crash the interpreter."
    • "Label between local definitions can mix-up their initializations."
    • "Return hook may not see correct values for active local variables when function returns."
    • "Suspended __le metamethod can give wrong result."
    • "Wrong code generated for a 'goto' followed by a label inside an 'if'."
  • Fixed the Lua debugger so 5-digit line numbers don't break indentation when showing source code lines.
clink - v1.6.2

Published by chrisant996 9 months ago

  • Added optional argument argmatcher:chaincommand(aliases) to let the argmatcher know that the chained command will have doskey aliases expanded.
  • Fixed match display potentially missing some matches (regression introduced in v1.6.1). In particular, git command completions were affected.
  • Fixed command line input parsing so that the first word (the command word) foo/ is interpreted as two words foo and / just like CMD does.
  • Fixed #549; cd - intercept interferes with cd doskey alias.
  • Fixed #546; in Windows 10 when "Wrap text output on resize" is unchecked or the Window Width is different from the Screen Buffer Width, then the display becomes garbled. The root cause is a limitation in how Windows 10 implements support for ANSI escape codes, but Clink now has workaround code that tries to compensate for the problems as much as possible (the terminal display will be a bit jittery, though; there's nothing that can be done about that).
  • Fixed updating the display after using clink-popup-show-help to invoke a command that changes only the cursor position.
  • Fixed a case where a custom strategy for auto-suggestions could accidentally skip inserting part of the suggestion.
  • Fixed a race condition where clink-diagnostics could encounter an error while printing information about coroutines.

Important pre-release changes in Readline:
Readline 8.2 introduced a crash in the undo command after navigating through history and making edits in history entries. The following pre-release updates in Readline fix the crash and several related issues. They also fix many other edge-case stability issues, and add a couple of new features.

  • Fixed crashes due to memory corruption in the undo information for editing operations.
  • Fixed many issues found by Address Sanitizer (ASAN); these are edge cases where crashes or memory corruption or malfunctions or memory leaks occurred.
  • Added new execute-named-command bindable command which reads a command name from the input and executes it (default is Alt-x).
  • Allow quoted-insert into search strings.
  • Repeated invocations of vi-yank-pop now cycle through the kill ring.
  • Fixed when do-lowercase-version is bound to something that's not an uppercase letter.
  • Fixed getting the value of the active-region-start-color config variable.