Releases: chrisant996/clink
Releases Β· chrisant996/clink
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).
v1.5.16
- Fixed #522; garbled display in JetBrains WebStorm terminal (regression introduced in v1.5.15).
- Fixing this required reverting the change that automatically chose a default for
color.suggestion
based on the current console colors.
- Fixing this required reverting the change that automatically chose a default for
- Fixed
:chaincommand()
so that generators and classifiers that come after argmatchers in the priority order receive the sameline_state
objects as ones that come before argmatchers in the priority order. - Fixed
:setdelayinit()
with linked argmatchers; the callback function was only called for registered argmatchers (e.g.clink.argmatcher("foo"):setdelayinit(func)
) and it wasn't called for linked argmatchers (e.g."-x" .. clink.argmatcher():setdelayinit(func)
). - Fixed the word parser to recognize a single digit as a word when followed by punctuation.
- Fixed
loopchars
for characters like-
or*
that are also Lua pattern characters.
v1.5.15
- Added localized descriptions for flag completions in
cmd
,cd
, andrd
. - Added partial ability to detect light/dark console color themes:
- Added
console.getcolortable()
which returns a table with the console's current 16 predefined colors. When possible, the table includes a field indicating whether the current console color theme is a light or dark theme. - At this time, the colors can be accurately retrieved only when using the legacy conhost terminal. When using Windows Terminal, ConEmu, or other ConPty-based terminals there is currently no way to accurately retrieve the colors. Once the Terminal#10639 issue is fixed then Clink will also detect the background color in these terminal programs.
- Changed the default for
color.suggestion
so that it attempts to detect light themes (bright background colors) when possible, and it attempts automatically choose a default color for suggestions that is faint but has sufficient contrast to be readable.
- Added
- Fixed the
onlink
callback function in:addflags()
so that thearg_index
parameter is correctly0
instead of1
. - Fixed the upper bound line number for Lua console line API functions.
- Fixed
console.getlinetext()
when emoji are present.
v1.5.14
- Added a visible usage hint for Auto-Suggestions to help make the feature more discoverable and usable. The usage hint can be hidden by turning off the
autosuggest.hint
setting. - Added a callback function that can be assigned to an argument position by including
onadvance=your_callback_function
in the table given to:addarg()
(see Responding to Arguments in Argmatchers for more information). - Fixed displaying match descriptions containing embedded color codes.
- Fixed finding argmatchers for doskey alias names containing quotes.
- Fixed parsing the input line when a doskey alias references a command with an argmatcher that uses the
:chaincommand()
function (e.g. an aliasfoo=sudo dir $*
with an argmatcher likeclink.argmatcher("sudo"):chaincommand()
so that completions and input line coloring work properly for the rest of the input line). - Fixed the
exec.commands
setting with an argmatcher that uses the:chaincommand()
function. - Fixed
_argmatcher:setclassifier()
so the custom classifier is called for flags as well as for arguments.
v1.5.13
- Added
clink.onhistory()
to register a function to be called when the input line has been accepted and is about to be added to history (and optionally cancel adding it). - Fixed
history delete
with a negative number so it indexes backwards from the end, as advertised. - Fixed calling
clink.refilterprompt()
from a coroutine, and related fixes to ensure various Lua functions coexist properly with coroutines. - Fixed #520; add a link to the Releases page in the updater dialog box.
v1.5.12
- Fixed updating the input line display after using
clink-popup-history
orwin-popup-history
(regression introduced in v1.5.3; the fix in v1.5.4 was incomplete). - Fixed
console.checkinput()
so it doesn't eat whatever pending input it detects. - Fixed the updater to be more specific about what PowerShell cmdlet it invokes, in case a module replaces the built-in
Expand-Archive
cmdlet.