clink

Bash's powerful command line editing in cmd.exe

GPL-3.0 License

Stars
3.5K
clink - v1.3.41

Published by chrisant996 about 2 years ago

  • Added io.truncate() to truncate a file.
  • Added string.comparematches() to compare two matches; this is normally not needed because Clink automatically sorts matches, but some match generators may prefer to disable the automatic sorting and perform custom sorting.
  • Added rl.describemacro() to associate descriptions with luafunc: macros (or any macro), to be shown in the clink-show-help and clink-what-is commands.
  • The clink.popuplist() function now accepts a callback function to be invoked when Del is pressed.
  • The colored-completion-prefix configuration variable now works with match display filtering, provided the display strings only prepend or append to the match strings.
  • Removed the obsolete clink.gui_popups setting.
  • Fixed the completion-prefix-display-length configuration variable in various cases.
  • Fixed timing condition that could potentially crash (regression introduced in v1.3.40).
clink - v1.3.40

Published by chrisant996 about 2 years ago

  • Clink now has an icon, and also includes some colored icons for color-coding your shortcut files, terminal tabs, and etc.
  • Avoid mis-coloring a directory name as though it is an argmatcher (uses a background thread to stay responsive).
  • Fixed command word completion after :chaincommand(). Now cmd /c Tab works properly.
  • Fixed :chaincommand() to work properly in a nested argmatcher; it should imply :nofiles() otherwise it can pop out to the previous argmatcher instead of chaining.
  • Fixed cmd argmatcher to only chain after the /c and /k flags, to more accurately match actual cmd.exe syntax.
  • Fixed backward compatibility for argmatchers using the old v0.4.9 APIs with functions as argument options (regression introduced in v1.2.7).
  • Fixed the clink-select-complete command with match display filtering.
clink - v1.3.39

Published by chrisant996 about 2 years ago

  • "Use enhanced defaults" now includes history timestamps.
  • Fixed delay while loading the history file when history timestamps are enabled (regression introduced in v1.3.18).
  • Fixed suggestions to resume after fully accepting an input line suggestion and then changing the text (regression introduced in v1.3.29).
  • Fixed reporting unbound commands in clink-show-help when arg is 4 (Alt-4,Alt-H) (regression introduced in v1.3.9).
  • Fixed to normalize path separators in a fully qualified pathname when using clink.argmatcher(full_path).
  • The documentation now shows a link icon when hovering over any heading or API name, to make it easy to copy and share links.
clink - v1.3.38

Published by chrisant996 about 2 years ago

  • Added clink.recognizecommand() function that input line coloring classifiers can use to find whether to color a word as executable. This is the same mechanism Clink uses internally, and the analysis is asynchronous.
  • Now clink.argmatcher(command) may be passed a fully qualified pathname for command to enable different argmatchers for programs with the same name.
  • Fixed argmatcher lookup to favor doskey aliases, so that e.g. "dir" can be aliased to an alternative program but " dir" can invoke the built-in dir command, and they can each have separate argmatchers.
  • Fixed the oncommand event to also fire when the command word offset changes, because adding/removing a leading space can change whether the command is an alias, which can make the typed command word resolve to a different file or program to invoke.
  • Fixed line_state:getcommandoffset() when the first word is quoted.
  • Fixed line_state parsing for input lines such as foo.exe&, so that the exec.enable setting can generate matches properly.
  • Fixed completion so that CMD command names are not among the completions when preceded by a quote.
  • Fixed color.argmatcher color to not overwrite custom colors that may have already been applied.
  • Fixed ^ to not be a word break character when parsing the input line.
clink - v1.3.37

Published by chrisant996 over 2 years ago

  • When argmatcher:addarg() is passed a table containing loopchars="chars" then the chars are treated as delimiters for a single argument, and they do not move on to the next argument slot in the parser.
  • Added clink.parseline() to parse a string into one or more line_state objects.
  • Added os.getdrivetype() to get the drive type for a path; especially useful if your code needs to skip network paths.
  • Added match_builder:setvolatile() to force the matches to be used only once. This makes it possible for match generators to produce different kinds of matches based on what has been typed, e.g. an email address match generator could list user names until @ is typed, and then list domain names.
  • The clink-diagnostics command now lists registered argmatchers when the numeric arg > 1 (Alt-2,Ctrl-x,Ctrl-r).
  • Rewrote the path parsing routines to properly respect UNC paths and \\?\ syntax and \\?\UNC\ syntax.
  • Fixed clink.print(NONL, etc) to not print a TAB character after a NONL that is the first argument.
  • Fixed #329; file completions may be mistakenly marked as directories (regression introduced in v1.2.36; affects only backward compatibility mode).
  • Fixed #326; rl.expandtilde() doesn't have a way to expand tildes everywhere in an input line string.
  • Fixed #325; potential hangs while typing if %PATH% contains a UNC path.
clink - v1.3.36

Published by chrisant996 over 2 years ago

  • Incremental search in clink-popup-history now centers the found item if it is scrolled out of view.
  • Tilde expansion is supported for all Lua script directory names and for the %CLINK_PROFILE% environment variable (but there is a quirk, and for the profile directory tilde expands to %LOCALAPPDATA% for backward compatibility purposes).
  • Fixed some tilde expansion issues; quotes weren't always recognized, and embedded tildes could in some cases result in malformed paths.
  • Fixed semicolon delimiter in %CLINK_COMPLETIONS_DIR%.
  • Fixed stack exhaustion crash when using inject --profile nul.
  • Fixed detection of device names when coloring command words; a device name anywhere in a path is not a valid executable.
clink - v1.3.35

Published by chrisant996 over 2 years ago

  • Fixed finding a completions directory under the profile directory.
  • Fixed finding a completions directory under script directories set via clink installscripts.
  • Fixed clink.refilterprompt() when the prompt wraps past the edge of the screen and a right-sided prompt string is present.
  • Fixed rl.getpromptinfo() when the prompt wraps past the edge of the screen (the promptline and inputline fields were inaccurate).
  • Fixed consistent sort order for completion matches that differ only by case.
  • Fixed undo (Ctrl-z) after using clink-reload (Ctrl-x,Ctrl-r). This also fixes rl.ismodifiedline() after clink-reload, which was causing clink-flex-prompt to show a modmark after clink-reload.
  • Fixed #321; incremental search not working in the clink-popup-history command (regression introduced in v1.3.19).
  • Fixed #320; prompt becomes garbled when prompt is updated by async prompt filters and wraps past the edge of the screen and a right-sided prompt string is present.
clink - v1.3.34

Published by chrisant996 over 2 years ago

v1.3.34

  • Improved error reporting in lua.debug mode for coroutine failures.
  • Fixed argmatcher flag definitions that begin with + (regression introduced in v1.3.11).
  • Fixed the updater when there are PowerShell configuration problems that cause internal errors unrelated to Clink's use of PowerShell.
  • Fixed potential coroutine failure if a delayinit argmatcher is still running after a new input line begins (regression introduced in v1.3.29).
  • Fixed os.getfileattributes(), os.isfile(), and os.isdir() to fail as intended when the input includes a wildcard (regression introduced in v1.1.0).
  • Fixed potential Lua error when typing a command name that included a wildcard, if the wildcard matched a file in a completions directory (regression introduced in v1.3.23, due to the os.getfileattributes() issue above).
clink - v1.3.33

Published by chrisant996 over 2 years ago

v1.3.33

  • The io.popenyield() function now also returns a function that can be used to get the exit status from the command.
  • Fixed io.popenyield() for some programs (such as FC and XCOPY) that fail to start if the stdin handle is empty.
  • Fixed slow startup due to inefficiency in the updater check at startup (regression introduced in v1.3.26).
clink - v1.3.32

Published by chrisant996 over 2 years ago

v1.3.32

  • The io.popenyield() function now also returns a function that can be used to get the exit status from the command.
  • Fixed io.popenyield() for some programs (such as FC and XCOPY) that fail to start if the stdin handle is empty.
  • Fixed slow startup due to inefficiency in the updater check at startup (regression introduced in v1.3.26).
clink - v1.3.31

Published by chrisant996 over 2 years ago

v1.3.31

  • Reverted the v1.3.29 change to file:close() that returned the process exit state even after io.popen() or io.popenyield() in a coroutine. It had subtle negative side effects.
clink - v1.3.30

Published by chrisant996 over 2 years ago

v1.3.30

  • Fixed the menu-complete family of commands for fromhistory argmatchers when autosuggest.enable is enabled.
  • Fixed #311; "The handle is invalid." (regression introduced in v1.3.29).
clink - v1.3.29

Published by chrisant996 over 2 years ago

Oops, sorry: If you see "Unable to find latest release zip file" or "Failed to unzip the latest release" or any other updater error, then you will need to manually update (it should only affect Windows 8.x users, or also users in locales where . is not the decimal separator).

Recent highlights:

  • The v1.3.13 release added features that make the i.lua script possible. Argmatchers can now be written to do match completion in directories other than the current directory. Argmatchers can also be written to take a whole command line as an argument: for example the built-in cmd argmatcher (cmd some_command).
  • Clink how has a built-in updater. See Automatic Updates for more information.

v1.3.29

  • Fixed how Right and etc work after fully accepting an input line suggestion. It shouldn't immediately show a new suggestion when the current suggestion is fully accepted (until the cursor is moved or the text changes), and win-cursor-forward shouldn't append characters from the previous command (e.g. when clink.default_bindings is windows). Otherwise holding or double-pressing Right can accidentally turn into something the user didn't intend.
  • Fixed double-loading completion script when a command word includes a path component (e.g. "c:\clink_dir\program.exe" mistakenly attempted to load "c:\clink_dir\program.lua" instead of loading "program.lua" from the completions directories).
  • Fixed delayinit argmatchers so they don't get orphaned if a new input line starts before they finish.
  • Fixed file:close() to be able to return the process exit state even after io.popen() or io.popenyield() in a coroutine.
clink - v1.3.28

Published by chrisant996 over 2 years ago

Oops, sorry: If you see "Unable to find latest release zip file" or "Failed to unzip the latest release" or any other updater error, then you will need to manually update (it should only affect Windows 8.x users, or also users in locales where . is not the decimal separator).

Recent highlights:

  • The v1.3.13 release added features that make the i.lua script possible. Argmatchers can now be written to do match completion in directories other than the current directory. Argmatchers can also be written to take a whole command line as an argument: for example the built-in cmd argmatcher (cmd some_command).
  • Clink how has a built-in updater. See Automatic Updates for more information.

v1.3.28

  • Fixed #309; some locales fail to parse the PowerShell version number.
clink - v1.3.27

Published by chrisant996 over 2 years ago

Oops, sorry: If you see "Unable to find latest release zip file" or "Failed to unzip the latest release", then you will need to manually update (it should only affect Windows 8.x users).

Recent highlights: The v1.3.13 release added features that make the i.lua script possible. Argmatchers can now be written to do match completion in directories other than the current directory. Argmatchers can also be written to take a whole command line as an argument: for example the built-in cmd argmatcher (cmd some_command).

v1.3.27

  • Added more detailed logging when the updater fails.
  • Added check to make sure PowerShell v5 is present when using clink update.
  • Added unicode.fromcodepage() and unicode.tocodepage() for UTF8 conversions. One of the cases where this can be useful is when handling redirected output from programs that product output using the current Active Code Page.
clink - v1.3.26

Published by chrisant996 over 2 years ago

Oops, sorry: If you see "Unable to find latest release zip file" or "Failed to unzip the latest release", then you will need to manually update (it should only affect Windows 8.x users).

Recent highlights: The v1.3.13 release added features that make the i.lua script possible. Argmatchers can now be written to do match completion in directories other than the current directory. Argmatchers can also be written to take a whole command line as an argument: for example the built-in cmd argmatcher (cmd some_command).

v1.3.26

  • Added unicode.iter(), unicode.isnormalized(), and unicode.normalize() for more precise UTF8 string manipulation.
  • The updater now includes an HTTP header to request no caching, in an effort to work around an issue on Win8.x.
  • The updater now updates the version number displayed in the "Apps & features" section of Settings in Windows (or "Add or Remove Programs" in Control Panel in older versions of Windows).
  • Fixed the directories.dupe_mode setting in clink set.
  • Fixed the remove-history command when trying to remove a history entry added by the add-history command that hasn't yet been saved.
  • Fixed the /D= flag in the setup program.
  • Fixed potential double-load of scripts in the profile or binaries directories, due to an issue while searching completions directories (regression introduced in v1.3.24).
  • Fixed potential infinite loop when merging an argmatcher with itself.
  • Fixed potential accidental resume of an orphaned coroutine.
  • Fixed potential double-reporting of coroutine errors when the lua.debug setting is enabled.
  • Internal maintenance to the coroutine management system.
clink - v1.3.25

Published by chrisant996 over 2 years ago

Oops, sorry: If you see "Unable to find latest release zip file" or "Failed to unzip the latest release", then you will need to manually update to v1.3.25 or higher (this should only affects Windows 8.x users).

Recent highlights: The v1.3.13 release added features that make the i.lua script possible. Argmatchers can now be written to do match completion in directories other than the current directory. Argmatchers can also be written to take a whole command line as an argument: for example the built-in cmd argmatcher (cmd some_command).

v1.3.25

  • Fixed updater when %TEMP% contains spaces.
  • Fixed executable file detection to color device names (such as nul, aux, con, lpt1, and com1) as neither recognized nor unrecognized.
  • Fixed #304; hang when typing device names (such as aux, con, lpt1, and com1) (regression introduced in v1.3.23).
  • Fixed #303; downloading latest update doesn't work on Windows 8.x.
clink - v1.3.24

Published by chrisant996 over 2 years ago

Oops, sorry: If you see "Unable to find latest release zip file", then you will need to manually update to v1.3.23 or higher.

Recent highlights: The v1.3.13 release added features that make the i.lua script possible. Argmatchers can now be written to do match completion in directories other than the current directory. Argmatchers can also be written to take a whole command line as an argument: for example the built-in cmd argmatcher (cmd some_command).

v1.3.24

  • Standardized the order in which completions directories are searched.
  • Fixed the second return value from clink.popuplist(), which was backwards by mistake.
clink - v1.3.23

Published by chrisant996 over 2 years ago

Oops, sorry: If you see "Unable to find latest release zip file", then you will need to manually update to v1.3.23 or higher.

Recent highlights: The v1.3.13 release added features that make the i.lua script possible. Argmatchers can now be written to do match completion in directories other than the current directory. Argmatchers can also be written to take a whole command line as an argument: for example the built-in cmd argmatcher (cmd some_command).

v1.3.23

  • Automatically loads Lua completion scripts from completions directories. This allows you to optionally store completion scripts (argmatcher scripts) in a separate directory from your other Lua scripts, so that completion scripts are only loaded when needed. This can speed up Clink start time, if you have a large volume of argmatcher scripts. See Completion Directories for more information.
  • Fixed clink.oncommand() when redirection appears on the command line before the command name (e.g. >somefile command).
  • Fixed both parts of #300; unable to find latest release zip file (incomplete fix in v1.3.22 by mistake).
clink - v1.3.22

Published by chrisant996 over 2 years ago

Recent highlights: The v1.3.13 release added features that make the i.lua script possible. Argmatchers can now be written to do match completion in directories other than the current directory. Argmatchers can also be written to take a whole command line as an argument: for example the built-in cmd argmatcher (cmd some_command).

v1.3.22

  • When the lua.debug setting is enabled, any uncaught errors in coroutines are reported (and logged).
  • Fixed edge case that could cause Windows Terminal to temporarily stop responding mouse input.
  • Fixed #300; unable to find latest release zip file.