Bash's powerful command line editing in cmd.exe
GPL-3.0 License
Published by chrisant996 over 1 year ago
clink update
to clarify that the update will take effect in new Clink windows.clink.autostart
setting) vs loading Lua; the autostart script should run before Lua so that Lua scripts can query environment variables set by it. Otherwise Lua scripts may behave differently on initial load versus after invoking the clink-reload
command (e.g. Ctrl-X,Ctrl-R).memset()
.Published by chrisant996 over 1 year ago
console.getcursorpos()
to get the cursor position.os.getscreeninfo()
to include the cursor position.cmd.ctrld_exits
so Ctrl-D always exits with return code 0, so that terminal programs allow the shell window to close gracefully.horizontal-scroll-mode
inputrc variable is on
.\
.Published by chrisant996 over 1 year ago
terminal.emulate
setting is auto
on Windows 8.1 and earlier (regression introduced in v1.4.26).Published by chrisant996 over 1 year ago
clink.getansihost()
to return two strings; the first string is the mode in use, and the new second string is what Clink detected (and will use when the terminal.emulation
setting is auto
).terminal.emulate
setting is auto
and ANSICON is present. Clink's output is no longer able to be intercepted by ANSICON, so bypass it and use Clink's own terminal emulation.Published by chrisant996 over 1 year ago
os.issignaled()
works during onendedit
and onfilterinput
events.win-history-popup
command); Left or Right replace the input text with the selected line.nil, false
.clink set --help
text.Published by chrisant996 over 1 year ago
path.fnmatch()
which behaves like the Linux fnmatch(3)
function.os.globmatch()
which performs recursive file pattern globbing the same as git does.%CLINK_PROMPT_PREFIX%
, %CLINK_PROMPT_SUFFIX%
, %CLINK_RPROMPT_PREFIX%
, and %CLINK_RPROMPT_SUFFIX%
to provide prefix/suffix strings to surround the prompt strings, and for prompt filters to define a :surround()
function to add their own prefix/suffix strings if needed.~
by itself to change directories, the same as ~\
.history delete #
doesn't work (regression introduced in v1.1.43)...\does_not_exist
(regression introduced in v1.4.1).Published by chrisant996 over 1 year ago
clink-select-complete
: when descriptions are shown below the matches, this adds text to mention that F1 toggles showing descriptions inline with the matches.clink update --check
to only check for an update without installing it.Published by chrisant996 over 1 year ago
clink-select-complete
to use per-match appendchar
when present.completion
auto-suggest strategy encounters a fromhistory
argument slot in an argmatcher./S
flag (silent install) so it returns exit code 0 on success.Published by chrisant996 over 1 year ago
clink-diagnostics
command can report merged argmatchers. When a numeric arg of 2 or greater is given (e.g. Alt-2,Ctrl-x,Ctrl-z) then it includes a list of defined argmatchers. The list now also reports any merging of argmatchers that occurred.clink update
so winget
doesn't get confused about whether an update is available for Clink. Once winget update clink
performs an update, or once a Clink v1.4.21 or greater .exe installer is run, then winget
should stop getting confused.Published by chrisant996 over 1 year ago
os.isfile()
and os.isdir()
when the specified name contains <
or >
or "
, which are special wildcard characters for MS-DOS compatibility. This caused an error when typing "<
, which then mistakenly thought a completion script named <.lua
existed.rl.expandtilde()
to omit a trailing backslash when expanding ~
by itself. This is to avoid running afoul of the \"
parsing rules for argv[]
for programs.clink
command line takes more bytes as UTF8 than it does as UTF16.Published by chrisant996 over 1 year ago
builder:setforcequoting()
to force quoting rules to be applied to matches even if they aren't filenames. This also reverts "quoting for non-filename completions" in v1.4.13; there isn't a safe and backward-compatible way to automatically deduce when non-filenames matches need quoting, so a match generator needs to turn it on explicitly when desired.Published by chrisant996 over 1 year ago
clink.oninputlinechanged()
to register a function to be called whenever the input line is changed.Published by chrisant996 over 1 year ago
os.isuseradmin()
to get whether CMD is running as an admin account.os.getfileversion()
to get a table with version information if the file contains a Windows version info resource.clink-diagnostics
command now reports costs for Lua event callback functions when a numeric arg is given (e.g. Alt-1,Ctrl-x,Ctrl-z) or when the lua.debug
setting is enabled.Published by chrisant996 over 1 year ago
history.show_preview
setting that controls whether to show a preview of history expansions (previously it was inferred by whether color.histexpand
was set).clink-diagnostics
Ctrl-X,Ctrl-Z command reports problem codes in the prompt string. When certain problem codes exist in the prompt string, then Clink compensates by reprinting the entire input line after printing the prompt string. Ideally, the prompt string should be fixed by the user, but sometimes that's difficult if the prompt string was generated by a tool.os.globdirs()
and os.globfiles()
(it had never worked properly). It worked fine with the default modes of the files.hidden
and files.system
settings and match-hidden-files
config variable. But if any of those were changed from the default values then malfunctions could occur. With the fix, in backward compatibility mode the files.hidden
and files.system
settings and match-hidden-files
config variable control whether os.globdirs()
and os.globfiles()
find hidden or system files, as before, and things can potentially malfunction. When the optional extrainfo
argument is non-zero or when a new optional flags
table is passed to them, they now default to including hidden files and omitting system files, but the flags
table can override that. This change was necessary because some scripts were unable to detect git repositories when the files.hidden
setting was false. Excluding hidden files never worked properly in the past. Clink v1.4.16 does its best to be as backward-compatible and forward-compatible as possible, but in some cases scripts may need to be updated to work properly when the settings or config variable are changed from their default values.match-hidden-files
config variable to work again (regression introduced in v1.0.0). Also, when off, now it hides files and directories whose names begin with .
.clink.bat
errors with quoted arguments (regression introduced in v1.3.47).Published by chrisant996 over 1 year ago
log.getfile()
to get the current log file path.colored-stats
is off
.Published by chrisant996 over 1 year ago
Published by chrisant996 over 1 year ago
clink-diagnostics
Ctrl-X,Ctrl-Z.insert-completions
Alt-* command.match_builder:setvolatile()
was called during an auto-suggest strategy.%CLINK_HISTORY_LABEL%
after Clink started didn't take effect (regression introduced in v1.3.18).Published by chrisant996 almost 2 years ago
clink inject
no longer empties the log file, so that AutoRun doesn't result in the log file being cleared over and over, which interferes with diagnostic efforts.complete
command gets confused by .
prefix on files.Published by chrisant996 almost 2 years ago
Published by chrisant996 almost 2 years ago
level
argument to log.info()
to facilitate more accurate reporting about the calling code.