clink

Bash's powerful command line editing in cmd.exe

GPL-3.0 License

Stars
3.5K
clink - v1.3.1

Published by chrisant996 almost 3 years ago

  • Added autosuggest.async setting (on by default) that lets suggestions generate matches asynchronously to stay responsive while typing.
  • Added match.max_rows setting that limits the number of rows clink-select-complete can use.
  • Added match.preview_rows setting that makes clink-select-complete show the specified number of rows of matches as a preview, and expands to show the full set of matches when the selection moves past the preview rows (similar to completion in the fish shell).
  • Added color.comment_row setting that chooses the color for the comment row in clink-select-complete. The comment row shows the "and N more matches" or "rows X to Y of Z" messages.
  • Changed arrow keys in clink-select-complete to wrap on both horizontal and vertical edges (similar to the fish shell).
  • Changed arrow keys in clink-select-complete at the beginning and end of the list to wrap to the other end based on the menu-complete-wraparound config variable.
  • Match generators can now specify an append character (or suppress appending) on a per-match basis.
  • The clink-diagnostics command lists prompt filters, generators, classifiers, and suggesters when a numeric argument is given (e.g. Alt+1 then Ctrl+X,Ctrl+Z).
  • The os.globdirs() and os.globfiles() functions now automatically yield periodically if used inside a coroutine.
  • The io.popen() function now automatically yields periodically if used in read mode (the default) inside a coroutine.
  • The io.popenyield() function now automatically falls back to io.popen() if used outside a coroutine.
  • Fixed input line coloring to operate on only the input line, not including the suggestion.
  • Fixed display when typing to filter clink-select-complete (regression introduced in v1.2.49).
  • Fixed display of clink-select-complete when the current match changes the number of visible lines in the edit buffer.
  • Fixed displaying matches when only a drive letter is entered.
  • Fixed #216; Long escaped URLs do not display correctly in a prompt.
clink - v1.3

Published by chrisant996 almost 3 years ago

  • Added back mark-modified-lines support (was removed in v1.2.36).
  • Added rl.ismodifiedline() function so prompt filters can show a modified line indicator if they wish.
  • Added autosuggest.original_case setting (on by default) that controls whether parts of the line are updated to use the suggestion's original capitalization, or to keep the typed capitalization.
  • Added terminal.east_asian_ambiguous setting that controls how the width is determined for the East Asian Ambiguous range of characters (which includes the lambda character). This may help with working around display issues in some terminal hosts.
  • Added help descriptions for many vi mode commands.
  • Improved relevance of completion suggestions by suppressing them when the word at the cursor is empty.
  • The :suggest() function on suggesters can now return a suggestion string and an offset where the suggestion begins in the input line.
  • Fixed a limitation in Readline so that completion-prefix-display-length and colored-completion-prefix can coexist.
  • Fixed when temp files from io.popenyield() get deleted. They were lingering until Lua garbage collection, but they can be deleted almost immediately.
  • Fixed the order of initialization: first the Readline .inputrc config file is loaded, and then Lua scripts are loaded. This enables Lua scripts to reliably override Readline config variables if they wish (for example so a prompt filter can clear emacs-mode-string and print its own keymap indicator as part of the prompt).
  • Fixed transient prompt to not show keymap mode strings or the modified line mark.
  • Fixed vi mode key bindings that can accept suggestions.
  • Fixed missing vi-undo command; it was pre-bound to some keys but could not be bound to any other keys.
  • Fixed the "show help" commands when listing unbound commands: unbound vi mode commands should not be listed in emacs mode because the vi mode commands are only meant to be used in vi mode, and are not meant to be bound to custom keys.
  • Fixed memory leak in suggestions.
clink - v1.2.50

Published by chrisant996 almost 3 years ago

  • Added rl.insertmode() function to get or set whether insert mode is active.
  • Added clink.onaftercommand() so scripts can registers a function to be called after every input command (key binding).
  • Added additional failure logging during clink inject.
clink - v1.2.49

Published by chrisant996 almost 3 years ago

  • Added cua-previous-screen-line and cua-next-screen-line, bound to Shift+Up and Shift+Down, to extend the text selection up/down by one screen line.
  • Updated match generator for clink set autosuggest.strategy to list the available suggestion generators.
  • The clink-show-help and clink-popup-show-help commands can include commands that aren't bound to any key, when the numeric argument is 4 (e.g. Alt+4 then Alt+H).
  • The rl.getkeybindings() function takes an optional mode argument to control sorting and whether to include commands that aren't bound to any key.
  • Generating suggestions skips generating match completions when the current word looks like a UNC path. This avoids pauses while typing that would otherwise occur when accessing networked drives.
  • Fixed Alt+Right so it accepts the next word of the suggestion, just like Ctrl+Right does.
  • Fixed the clink-paste command so it sets the mark to the cursor point prior to pasting.
  • Fixed when history.dupe_mode is "erase_prev" and history.shared starts true but changes to false; subsequent commands were not added to the history properly anymore in that session (regression introduced in v1.1.0).
  • Fixed #210; clink-select-complete drawing bug with RPROMPT.
clink - v1.2.48

Published by chrisant996 almost 3 years ago

new in v1.2.48

  • Ctrl+Right now inserts the next word of the suggestion the same way it would move to the next word, and Shift+Right inserts the next full word of the suggestion up to a space.
  • Keys like Home/End, Shift+Left/Right, and Ctrl+Left/Right work in VI mode.
  • Fixed input line coloring glitch when color settings use the sgr syntax.

new in v1.2.47

  • Added autosuggestions similar to the Fish shell.
    • Turn on by running clink set autosuggest.enable true. See the autosuggest.enable and autosuggest.strategy Clink settings for details.
    • Added clink.suggester() function to create new suggestion generators that can be used in the autosuggest.strategy setting.
  • The clink-diagnostics command also lists match generators registered by clink.generator().
  • Fixed the color when the horizontal-scroll-mode config variable is on.
  • Fixed the transient prompt when using Help commands.
  • Fixed the clink autorun commands when paths contain Chinese characters and the system code page isn't UTF8.
  • Fixed #209; clink-popup-show-help command fails.
  • Fixed #208; orphaned symlinks are colored wrong.
  • Fixed #203; unable to inject when Clink binary directory contains Chinese characters (regression introduced in v1.0.0).
clink - v1.2.47

Published by chrisant996 almost 3 years ago

  • Added autosuggestions similar to the Fish shell.
    • Turn on by running clink set autosuggest.enable true. See the autosuggest.enable and autosuggest.strategy Clink settings for details.
    • Added clink.suggester() function to create new suggestion generators that can be used in the autosuggest.strategy setting.
  • The clink-diagnostics command also lists match generators registered by clink.generator().
  • Fixed the color when the horizontal-scroll-mode config variable is on.
  • Fixed the transient prompt when using Help commands.
  • Fixed the clink autorun commands when paths contain Chinese characters and the system code page isn't UTF8.
  • Fixed #209; clink-popup-show-help command fails.
  • Fixed #208; orphaned symlinks are colored wrong.
  • Fixed #203; unable to inject when Clink binary directory contains Chinese characters (regression introduced in v1.0.0).
clink - v1.2.46

Published by chrisant996 almost 3 years ago

  • Added a magic-space command that performs history expansion on the text before the cursor point and then inserts a space. Note: this is slightly different than one in bash, which performs history expansion on the whole line and can end up inserting the space in a wrong spot.
  • Added rl.getbinding() and rl.setbinding() functions to query or override key bindings.
  • Added a clink.refilterprompt() function to invoke prompt filtering on demand.
  • The clink-popup-directories command is now bound by default to Ctrl+Alt+PgUp.
  • The clink-select-complete command is now bound by default to Ctrl+Space.
  • Fixed the clink-popup-history command so incremental search works again (regression introduced in v1.2.36).
  • Fixed messages sometimes not being erased when finished, e.g. when using Alt+digits (regression introduced in v1.1.11).
  • Fixed potential for prompt to redraw incorrectly after showing help when the prompt.transient setting is enabled.
  • Fixed settings defined by Lua scripts so that the Lua scripts can reliably see the current values even while the Lua scripts are being loaded or reloaded.
clink - v1.2.45

Published by chrisant996 almost 3 years ago

  • Clarified description of the match.wild Clink setting.
  • Fixed #196; installer checkboxes not working properly.
clink - v1.2.44

Published by chrisant996 almost 3 years ago

  • Fixed clink.ondisplaymatches() so it receives the right match strings (regression introduced in v1.2.39).
  • Fixed #194; argmatcher not found when command name contains a dash (regression introduced in v1.1.5).
  • Fixed #176; use current installation dir when upgrading clink. Now the installer remembers the chosen installation directory and defaults to the same place when installing an upgrade (all of the checkbox states are remembered, in fact).
  • Fixed #171; have a way to override install directory. Now the installer has a checkbox whether to install to a versioned directory (recommended). Unchecking the box installs program files to a bin subdirectory, instead of the usual versioned subdirectory.
clink - v1.2.43

Published by chrisant996 almost 3 years ago

  • Fixed lingering issues with non-ASCII characters in path names in Clink (follows up on the preceding fixes for non-ASCII user name characters).
clink - v1.2.42

Published by chrisant996 almost 3 years ago

  • Fixed potential for history file to get corrupted during compacting, if multiple Clink instances are running concurrently.
  • Fixed clink inject when the user account name contains non-ASCII characters (regression introduced in v1.0.0).
  • Fixed #193; consider removing the 50K history limit: The history.max_lines Clink setting once again supports 0 to mean unlimited. Note that as the history file grows larger, it takes longer to load. If the size becomes a problem, you can use clink history compact <n> to prune the history file to N items as well as compacting it (removing deleted items).
  • Fixed #192; completing ~ by itself does nothing: Completing ~ by itself now inserts the %USERPROFILE% directory. This is different than bash, because on Windows it doesn't make sense for ~ by itself to complete other user accounts. This is a convenient way to expand tilde into a path that Windows understands.
  • Fixed #191; cd /d - isn't supported: The cd - feature now supports cd /d - as well. It also supports cd - even if there is a doskey macro defined for cd.
clink - v1.2.41

Published by chrisant996 almost 3 years ago

  • Fixed #187 differently: doskey.enhanced is true by default again, but if a macro contains $* or $1...$9 tags within quotes then | and & symbols are part of the arguments, not command separators (and expansion stops after that macro).
  • Fixed compatibility when doskey.enhanced is false; alias|whatever should not expand alias because there is no space after it.
  • Fixed doskey expansion when >& redirection symbol is present; command >& alias should not attempt to expand alias because it's a redirection file name, not a command.
clink - v1.2.40

Published by chrisant996 almost 3 years ago

  • Fixed display quirks when an empty display or description string is provided by a match generator.
  • Fixed #187; the doskey.enhanced setting interferes with some macros (regression introduced in v1.0.0). The setting is now false by default, because of the incompatibilities it can cause.
clink - v1.2.39

Published by chrisant996 almost 3 years ago

  • Fixed regression in match display filtering when listing possible completions (regression introduced in v1.2.38).
  • Fixes display quirks in the clink-select-complete command when descriptions are at the bottom or when an empty display or description string is provided by a match generator.
clink - v1.2.38 -- fancy enhancements for argmatchers

Published by chrisant996 almost 3 years ago

Highlights:

  • 😎 Argmatchers can supply descriptions for flags or arguments.
  • 🎉 Match generators can include display and description fields directly -- there's no need to mess around with match display filtering anymore.
  • 🐞 Lots of minor bugs fixed.

Full list of changes:

  • Enhancements for match descriptions (which are displayed when listing possible completions):
    • Argmatchers can provide description strings for flags and/or args (e.g. "Verbose output" for -v, or "Do nothing" for -n, etc).
    • Argmatchers can also provide argument info strings for flags and/or args. These are hint strings, and not part of the completion match itself. E.g. "linenum" for --line, which gets displayed as "--line linenum" when listing possible completions, but only "--line" is inserted.
    • Match generators can provide display and description strings when adding matches (match_builder:addmatch() and match_builder:addmatches()) -- it is no longer necessary to use clink.ondisplaymatches().
    • The clink-select-complete command now shows match descriptions in a single line at the bottom (instead of in a second column) when there are more than 9 matches.
    • Added color.arginfo Clink setting for the arguments for a flag or argument when listing possible completions.
    • Added color.description Clink setting for the default match description color when listing possible completions.
    • Truncate descriptions when a line will wrap (or has wrapped) when listing possible completions.
  • Command separators (&, |) and redirection symbols (<, >, >&) are colored in the input line, using colors from the new color.cmdsep and color.cmdredir Clink settings.
  • Fixed Backspace in clink-select-complete; it had sometimes missed expanding the set of matches accordingly.
  • Fixed the clink-popup-history command to respect the search-ignore-case setting.
  • Fixed :nofiles() to dead-end an argmatcher (regression introduced in v1.0.0).
  • Fixed clink.ondisplaymatches() and clink.onfiltermatches() when there's only 1 match.
  • Fixed incremental find, find next, and find previous in console text popup lists.
  • Fixed backward compatibility for the old matching filtering API.
  • Fixed several other minor issues with match display filtering.
  • Fixed intermittent incorrect match generation for /flag: or /flag= flags.
  • Fixed duplicate removal with deprecated match generators.
  • Fixed when nested deprecated argmatchers are exhausted (regression introduced in v1.2.36).
  • Fixed deprecated match generators to not infer whether matches are filenames, to match the behavior of the v0.4.9 API.
  • Fixed how match.wild works with deprecated match generators; e.g. arg completions for z.lua weren't working (regression introduced in v1.1.5).
  • Fixed argmatcher for clink --profile so it produces directory matches.
  • Fixed %CLINK_RPROMPT% alignment when color.prompt is set.
clink - v1.2.37

Published by chrisant996 about 3 years ago

  • Fixed #180; rl.collapsetilde() behaves erratically.
  • Fixed #179; incorrect handling for certain keys on some keyboard layouts.
  • Fixed #178; OneDrive folders mistakenly show up as symlinks.
  • Fixed #177; be silent about autorun injection into TCC.
clink - v1.2.36

Published by chrisant996 about 3 years ago

  • Added win-history-list command bound to F7 by default. This shows the history list, and executes the selected history entry.
  • Changed all of the popup list commands to show popups using console text rather than GUI windows.
    • Added a color.popup Clink setting for the popup colors. If not set, the console's popup colors are used.
    • Added a color.popup_desc Clink setting for the popup colors for the description column(s). If not set, a color is chosen to complement the console's popup colors.
    • Added a clink.gui_popups Clink setting that can be set to use GUI popup windows as before (the color.popup settings have no effect on GUI popup windows).
  • Key bindings now support Enter plus combinations of the Ctrl, Shift, or Alt modifier keys.
  • Added more backward compatibility shims.
  • Fixed the clink-select-complete command when print-completions-horizontally is on (and also minor issues when it is off).
  • Fixed the clink-select-complete command when a Lua script has used rl.setmatches() to provide a custom list of matches.
  • Fixed the clink-menu-complete-numbers family of commands (regression introduced in v1.2.32).
  • Fixed a situation where the scrolling keys could stop working (regression introduced in v1.2.24).
  • Fixed flags at the end of a linked parser, and fixed args at the end of two or more nested linked parsers (regression introduced in v1.0.0).
  • Fixed #172; add a choice in the installer to not add Start menu shortcuts.
  • Fixed #129; Bug completing files with - or _ characters (regression introduced in v1.0.0).
clink - v1.2.35

Published by chrisant996 about 3 years ago

  • Added rl_buffer:getanchor() to get the text selection anchor (there is no set function; use rl.invokecommand() to invoke commands to set/extend the selection if needed).
  • Reverted back to using IAT hooking (see issue #169).
  • Fixed CUA selection commands invoked by rl.invokecommand().
  • Fixed #170; directory symlink completion is truncated when mark-directories is off in the .inputrc file.
  • Fixed #169; incompatibility between AutoHotkey, AnsiCon, and Clink when all three are used in CMD's AutoRun regkey (regression introduced in v1.2.33).
clink - v1.2.34

Published by chrisant996 about 3 years ago

  • Changed "luafunc:" macro functions to receive the line_state as a second argument.
  • Fixed Right when clink.default_bindings is windows.
  • Fixed exec.files setting so completion works when a path is specified (e.g. subdir\foo) (regression introduced in v1.2.33).
  • Fixed #158; crash when a keyboard macro contains \015 (regression introduced in v1.0.0).
clink - v1.2.33

Published by chrisant996 about 3 years ago

  • Rewrote how Clink hooks APIs in CMD.EXE; it no longer uses any IAT hooking, and exclusively uses Detours.
  • Added clink.default_bindings Clink setting to choose between bash or windows default key bindings. bash key bindings are still the default, for compatibility with existing Clink installations.
  • Added exec.aliases, exec.commands, and exec.files Clink settings to further customize how matches are generated for the first word when the exec.enable Clink setting is enabled.
  • Small performance optimization in the hooked WriteConsoleW() system API.
  • Added logging for rare error case during inject.
  • Added default key bindings for F1 through F9 that mimic the default Windows console function key inputs.
  • Added clink-selectall-conhost command that mimics the default Windows console Select All command.
  • Fixed clink-select-complete to remove duplicate matches if generators try to add duplicate matches.
  • Fixed script error when %PATH% is not set and exec.enable and exec.path are both enabled.
  • Fixed some quirks when using the quoted-insert command.