Bash's powerful command line editing in cmd.exe
GPL-3.0 License
Published by chrisant996 about 2 years ago
io.truncate()
to truncate a file.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.rl.describemacro()
to associate descriptions with luafunc:
macros (or any macro), to be shown in the clink-show-help
and clink-what-is
commands.clink.popuplist()
function now accepts a callback function to be invoked when Del is pressed.colored-completion-prefix
configuration variable now works with match display filtering, provided the display strings only prepend or append to the match strings.clink.gui_popups
setting.completion-prefix-display-length
configuration variable in various cases.Published by chrisant996 about 2 years ago
:chaincommand()
. Now cmd /c Tab works properly.:chaincommand()
to work properly in a nested argmatcher; it should imply :nofiles()
otherwise it can pop out to the previous argmatcher instead of chaining.cmd
argmatcher to only chain after the /c
and /k
flags, to more accurately match actual cmd.exe syntax.clink-select-complete
command with match display filtering.Published by chrisant996 about 2 years ago
clink-show-help
when arg is 4 (Alt-4,Alt-H) (regression introduced in v1.3.9).clink.argmatcher(full_path)
.Published by chrisant996 about 2 years ago
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.clink.argmatcher(command)
may be passed a fully qualified pathname for command to enable different argmatchers for programs with the same name.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.line_state:getcommandoffset()
when the first word is quoted.line_state
parsing for input lines such as foo.exe&
, so that the exec.enable
setting can generate matches properly.color.argmatcher
color to not overwrite custom colors that may have already been applied.^
to not be a word break character when parsing the input line.Published by chrisant996 over 2 years ago
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.clink.parseline()
to parse a string into one or more line_state
objects.os.getdrivetype()
to get the drive type for a path; especially useful if your code needs to skip network paths.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.clink-diagnostics
command now lists registered argmatchers when the numeric arg > 1 (Alt-2,Ctrl-x,Ctrl-r).\\?\
syntax and \\?\UNC\
syntax.clink.print(NONL, etc)
to not print a TAB character after a NONL
that is the first argument.rl.expandtilde()
doesn't have a way to expand tildes everywhere in an input line string.%PATH%
contains a UNC path.Published by chrisant996 over 2 years ago
clink-popup-history
now centers the found item if it is scrolled out of view.%CLINK_PROFILE%
environment variable (but there is a quirk, and for the profile directory tilde expands to %LOCALAPPDATA%
for backward compatibility purposes).%CLINK_COMPLETIONS_DIR%
.inject --profile nul
.Published by chrisant996 over 2 years ago
completions
directory under the profile directory.completions
directory under script directories set via clink installscripts
.clink.refilterprompt()
when the prompt wraps past the edge of the screen and a right-sided prompt string is present.rl.getpromptinfo()
when the prompt wraps past the edge of the screen (the promptline
and inputline
fields were inaccurate).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
.clink-popup-history
command (regression introduced in v1.3.19).Published by chrisant996 over 2 years ago
lua.debug
mode for coroutine failures.+
(regression introduced in v1.3.11).delayinit
argmatcher is still running after a new input line begins (regression introduced in v1.3.29).os.getfileattributes()
, os.isfile()
, and os.isdir()
to fail as intended when the input includes a wildcard (regression introduced in v1.1.0).completions
directory (regression introduced in v1.3.23, due to the os.getfileattributes()
issue above).Published by chrisant996 over 2 years ago
io.popenyield()
function now also returns a function that can be used to get the exit status from the command.io.popenyield()
for some programs (such as FC and XCOPY) that fail to start if the stdin handle is empty.Published by chrisant996 over 2 years ago
io.popenyield()
function now also returns a function that can be used to get the exit status from the command.io.popenyield()
for some programs (such as FC and XCOPY) that fail to start if the stdin handle is empty.Published by chrisant996 over 2 years ago
file:close()
that returned the process exit state even after io.popen()
or io.popenyield()
in a coroutine. It had subtle negative side effects.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:
cmd
argmatcher (cmd some_command
).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.file:close()
to be able to return the process exit state even after io.popen()
or io.popenyield()
in a coroutine.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:
cmd
argmatcher (cmd some_command
).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
).
clink update
.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.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
).
unicode.iter()
, unicode.isnormalized()
, and unicode.normalize()
for more precise UTF8 string manipulation.directories.dupe_mode
setting in clink set
.remove-history
command when trying to remove a history entry added by the add-history
command that hasn't yet been saved./D=
flag in the setup program.completions
directories (regression introduced in v1.3.24).lua.debug
setting is enabled.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
).
%TEMP%
contains spaces.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
).
completions
directories are searched.clink.popuplist()
, which was backwards by mistake.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
).
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.clink.oncommand()
when redirection appears on the command line before the command name (e.g. >somefile command
).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
).
lua.debug
setting is enabled, any uncaught errors in coroutines are reported (and logged).