Releases: chrisant996/clink
Releases Β· chrisant996/clink
v1.6.7
- Recognize the little-known
cmd /r
as a synonym forcmd /c
so that Clink can optimize and skip injecting into acmd /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 whenexec.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.
v1.6.6
- Added
clink history --no-show-time
to allow omitting history timestamps even when thehistory.time_stamp
setting isshow
. - 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 inio.open()
andio.sopen()
(the behavior was correct, but the documentation was inaccurate/unclear).
v1.6.5
- 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.
v1.6.4
- Added
rl_buffer:hassuggestion()
andrl_buffer:insertsuggestion()
for direct access to inserting suggestions without invoking Readline commands. - Added
clink.dirmatchesexact()
andclink.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 theexec.enable
setting is enabled. - Fixed applying
colored-completion-prefix
when match display filtering is active or a match has a customdisplay
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.
v1.6.3
- 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-_"
orC-_
"\e[27;5;189~"
Ctrl-Shift-- "\e[27;6;189~"
"\C-_"
orC-_
Ctrl-Alt-- "\e\C-_"
or"\M-\C-_"
orM-C-_
or etc"\e[27;7;189~"
Ctrl-Alt-Shift-- "\e[27;8;189~"
"\e\C-_"
or"\M-\C-_"
orM-C-_
or etc - Completions for all
clink set
settings include the current value in the description field (e.g. typeclink set
Alt-= to see Clink settings and their current values). - Fixed to differentiate between
undo
andvi-undo
commands again (they do the same thing, but are technically different commands). - Fixed
execute-named-command
to also accept Ctrl-- forundo
(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.
v1.6.2
- 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 wordsfoo
and/
just like CMD does. - Fixed #549;
cd -
intercept interferes withcd
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.
v1.6.1
Features:
- Improved input line parsing and coloring:
- Commands starting with
@
are supported, and completion correctly ignores the@
. - Each of the following CMD syntax errors are recognized: lines starting with
&
or@2>
, and lines containing& &
or2>&file
. - The whole redirections
2>file
or>file
or2>&1
are colored instead of only the>
or>&
.
- Commands starting with
- Completions for
clink set
color settings include a color sample in the description field (e.g. typeclink set color
Alt-= to see the color settings and their current color samples). - The
clink-reload
bindable command now reverts key bindings and config variables before reloading the inputrc file, so that old bindings and values don't linger in the current session if they've been removed from the inputrc file. - Added
clink-dump-functions
andclink-dump-macros
bindable commands. These behave similar todump-functions
anddump-macros
, but they show user-friendly key names andluafunc:
macros are listed as functions instead of as macros. - Added some new "bigword" cursor movement commands for moving to the next or previous space delimited word;
clink-backward-bigword
,clink-forward-bigword
,cua-backward-bigword
,cua-forward-bigword
. - Added a new conditional directive
$if clink_version
in the inputrc file (e.g.$if clink_version >= 1.6.1
). - Added a new
prompt.spacing
setting which can control blank lines before the prompt (it was a clink-flex-prompt feature which has now been incorporated into Clink itself). - Added a new
match.coloring_rules
setting and%CLINK_MATCH_COLORS%
environment variable, both of which supersede Readline's%LS_COLORS%
definitions when displaying match completions. - Internal changes.
Lua:
- Added
line_state:getrangeoffset()
andline_state:getrangelength()
to get the beginning offset and length of the range in the input line described by the line_state. - Added
console.explodeansi()
to split a string into substrings on ANSI escape code boundaries. - Added
rl.getinputrcfilename()
to get the loaded inputrc file name. - Added
rl.translatekey()
to translate between key sequence formats (input key, key binding, and friendly key name). - Added
rl.bracketpromptcodes()
to apply\1
and\2
codes as needed by Readline in certain inputrc config variables. - Document the
CLINK_EXE
global variable which has existed since v1.0.0 but was accidentally undocumented.
Fixes:
- Removed superfluous
;39
and/or;49
from color setting escape codes in some cases. - Fixed
console.readinput()
repeatedly returning nil afterconsole.checkinput()
returns true (regression introduced in v1.5.12). - Fixed loading the
default_inputrc
file if it exists (introduced in v1.3.5, and it never worked properly until now). - Fixed the
history-size
config variable to be completely ignored (it interfered with Clink's history database and settings, which were meant to supersede it). - Fixed the
clink-popup-show-help
command when including unbound commands (numeric argument of 4) so it doesn't double-list the boundluafunc:
macros. - Fixed updating column text in
clink.popuplist()
when Del is pressed (e.g. history timestamps in theclink-popup-history
command). - Fixed the width of
clink.popuplist()
to take the title into account. - Fixed Lua argument errors for some objects (the argument # in the error message was one lower than it should have been in some messages).
- Fixed the return value from
rl_buffer:setcursor()
. - Fixed
console:getnumlines()
between onendedit and onbeginedit. - Fixed erasing the "History expansion for" preview when the transient prompt is enabled.
- Fixed the transient prompt sometimes not erasing properly (regression introduced in v1.5.17).
- Fixed the color of flags for
clink set
(e.g.--help
). - Fixed the
clink-reload
command so any inputrc file parse errors are printed on new lines. - Fixed the
lua.break_on_error
setting so it works properly in released builds of Clink.
v1.6.0
- Updated the Readline library to v8.2 patch 7 (the list here omits changes that were contributed to Readline from Clink, or which do not affect Clink).
- New features:
- History expansion better understands multiple history expansions that may contain strings that would ordinarily inhibit history expansion (e.g.,
abc!$!$
). - There is a new
fetch-history
bindable command that retrieves the history entry corresponding to its numeric argument. Negative arguments count back from the end of the history. - There is a new option:
enable-active-region
. This separates control of the active region and bracketed-paste. It has the same default value asbracketed-paste
, and enabling bracketed paste enables the active region. Users can now turn off the active region while leaving bracketed paste enabled. - Readline looks in
%LS_COLORS%
for a custom filename extension (*.readline-colored-completion-prefix
) and uses that as the default color for the common prefix displayed whencolored-completion-prefix
is set, superseding theso
type if both are present. - Two new bindable string variables:
active-region-start-color
andactive-region-end-color
. The first sets the color used to display the active region; the second is unused and unnecessary in Clink, but exists anyway for compatibility. If set, these are used in place of terminal standout mode.
- History expansion better understands multiple history expansions that may contain strings that would ordinarily inhibit history expansion (e.g.,
- Fixes:
- Fixed a problem with cleaning up active marks.
- Fixed a problem with arithmetic comparison operators checking the version in the inputrc file.
- Fixed a bug that could cause readline to crash if the application removed the callback line handler before readline read all typeahead.
- Added additional checks for read errors in the middle of readline commands.
- Fixed a problem with
unix-filename-rubout
that caused it to delete too much when applied to a pathname consisting only of one or more slashes. - Fixed a problem that caused the
\r
output by turning off bracketed paste to overwrite the line if terminal echo was disabled. - Fixed a couple problems where
transpose-words
could corrupt the end of the input line. - Fixed an issue that caused a history line's undo list to be cleared when it should not have been.
- Fixed leaked memory from undo lists.
- When replacing a history entry, make sure the existing entry has a non-NULL timestamp before copying it; it may have been added by the application, not the history library.
- New features:
- The
blink-matching-paren
setting works in Clink now. - Completion works for UNC share names now (share names like
\\server\share
, not server names like\\server
). - Improved undo grouping for consecutive inserted text.
- Added
os.enumshares()
to enumerate the SMB UNC shares on a given server. - Fixed Lua error messages from custom Lua libraries that report errors using table objects instead of strings.
- Fixed issue with the
autosuggest.hint
setting where it could apply incorrect input line coloring when the Right key isn't bound to one of the usual commands for that key. - Internal changes and optimizations.
v1.5.18
- Fixed #524 and #523; garbled display in wide terminal windows (regression introduced in v1.5.14, which exacerbated and revealed a bug that's existed since Clink v1.0.0 alpha and which could intermittently garble Unicode text or escape sequences).
- Fixed the transient prompt sometimes not displaying properly (regression introduced in v1.5.17).
v1.5.17
- Reduced flicker when async prompt filtering redraws the prompt.
- When
_argmatcher:addarg()
or_argmatcher:addflags()
is passed a table containingnowordbreakchars="chars"
then the chars are not treated as word breaks for that argument index or for flags (see Overcoming Word Breaks for more information). - Added a
user_data
argument to the custom classifier function for an argmatcher (set via_argmatcher:setclassifier()
). - Improved input line coloring for
clink set
so thatcolor.unexpected
is only used for a completed word that isn't a match. - Fixed reading lines from stdin in Lua scripts (e.g.
io.stdin:read()
). - Fixed accidentally showing matches in a single column sometimes even when there are no descriptions.
- Fixed an incomplete
clink inject
if an explicit or implicitendlocal
happens afterclink inject
but before the prompt is shown (the injection didn't finish successfully until the next time an environment variable was set, but now it finishes immediately).