Bash's powerful command line editing in cmd.exe
GPL-3.0 License
Published by chrisant996 about 3 years ago
rl_buffer:setargument()
function for a "luafunc:" macro to be able to set Readline's numeric argument.os.getclipboardtext()
and os.setclipboardtext()
functions.rl_buffer:getcursor()
and the return value from rl_buffer:setcursor()
; both returned one less than the actual cursor position.Published by chrisant996 about 3 years ago
clink uninstallscripts --all
to clear all script paths installed by clink installscripts
.os.touch()
function to set the access and modified times for a file.os.globdir()
and os.globfiles()
when extrainfo
is requested.os.globdir()
and os.globfiles()
to only return extra info when actually requested (regression introduced in v1.1.8).
clink-select-complete
when a match display filter returns nil.ondisplaymatches()
which was receiving one fewer matches than it should (related to #124).ondisplaymatches()
which was not using the word break info correctly (from generators' :getwordbreakinfo()
functions).word_classifications:applycolor()
; the input line didn't necessarily refresh correctly after a custom classifier applied custom colors.clink set color.something some_value
.clink installscripts
garbles previously-installed script paths when installing a new one.settings.set()
doesn't update the settings file.Published by chrisant996 about 3 years ago
os.clock()
so it doesn't stop working after the program has been running for more than 24 days (which caused asychronous prompt filtering to stop working). As a side effect, the new os.clock()
has microsecond precision instead of millisecond precision.Published by chrisant996 about 3 years ago
prompt.transient
Clink setting which can collapse prior prompts to a condensed form. The new %CLINK_TRANSIENT_PROMPT%
and %CLINK_TRANSIENT_RPROMPT%
environment variables supply the initial prompt strings, and prompt filters can define :transientfilter()
and :transientrightfilter()
functions to filter the transient prompt.clink.logo
Clink setting to globally control what startup logo is shown (full copyright logo by default, or a short version logo, or no startup logo).console.readinput()
function which waits for one key input, and returns the key sequence string for the key.console.reload()
function which reloads Lua scripts and the Readline config file at the next prompt.clink set cl*
lists all settings that begin with cl
(the star wildcard is only supported at the end of the string).esc_clears_line
setting backwards, causing Esc to behave opposite from what was expected.Published by chrisant996 about 3 years ago
rl.getpromptinfo()
function.$include
directive in the Readline init file, to load additional files.clink-select-complete
to respect when mark-directories
in .inputrc file if off
.console.findline()
when no attributes are passed. Callers using v1.2.27 and earlier can work around the crash by passing {}
for attributes.console.scroll("absolute", top)
. This will fix edge case malfunctions in some callers, but some callers could experience this as a breaking change.Published by chrisant996 about 3 years ago
cmd.get_errorlevel
Clink setting is now enabled by default.$
codes in %CLINK_RPROMPT%
before running prompt filters.2>&1
style redirection symbols, so the &
doesn't get treated as a command separator.app.exe >
should generate file matches for the >
symbol, not matches for the app
argmatcher's first argument.Published by chrisant996 about 3 years ago
clink-select-complete
when there were already opening and closing quotes present.clink-show-help
Alt+H (regression introduced in v1.1.20).completion-auto-query-items
config variable to account for multiple lines of input, if present.Published by chrisant996 about 3 years ago
cua-select-all
command to select the entire input line.edit-and-execute-command
command to invoke an editor on the current input line and then execute the results (Ctrl+X,Ctrl+E). This attempts to invoke %VISUAL%
, %EDITOR%
, or notepad.exe
as the editor, in that order.clink-expand-history
performs history expansion on the current input line (Alt+^).clink-expand-history-and-alias
performs history and doskey alias expansion on the current input line.clink-expand-line
performs history, doskey alias, and environment variable expansion on the current input line (Ctrl+Alt+E).glob-complete-word
performs wildcard completion on the text before the cursor point, with a *
implicitly appended (Alt+G).glob-expand-word
inserts all the wildcard completions that glob-list-expansions
would list (Ctrl+X,*).glob-list-expansions
lists the possible wildcard completions of the text before the cursor point (Ctrl+X,g).alias-expand-line
is a synonym for clink-expand-doskey-alias
.history-expand-line
is a synonym for clink-expand-history
.history-and-alias-expand-line
is a synonym for clink-expand-history-and-alias
.insert-last-argument
is a synonym for yank-last-arg
.shell-expand-line
is a synonym for clink-expand-line
.match.expand_envvars
Clink setting to expand environment variables in a word before performing completion (for mridgers #476).match.wild
Clink setting to apply to all completion commands.clink-expand-line
command (not the key binding expands everything, instead of only the env var at the cursor).clink-show-help-raw
command (it has only niche usefulness).More?
continuation prompt when pasting multiple lines./flag:
and /flag=
handling quirks, especially when trying to complete an environment variable in /flag:%env
.clink-expand-env-var
command and the os.expandenv()
function.Published by chrisant996 about 3 years ago
%CLINK_RPROMPT%
to show a right side prompt, and for prompt filters to define a :rightfilter()
function to filter the right side prompt.clink-select-complete
to not append a space after a flag that ends with :
or =
(e.g. /x:
).Published by chrisant996 over 3 years ago
This includes all of the planned features I had when I started updating Clink ten months ago. So there will be less frequent updates now, and I anticipate they will mostly be minor bug updates.
(Sorry, there were 2 minor bugs in v1.2.22 that I figured I may as well fix before Cmder picks up a next Clink version.)
What's new in v1.2.23:
clink-select-complete
command, under certain conditions where they don't navigate in the intended manner.terminal.differentiate_keys
setting.Published by chrisant996 over 3 years ago
This includes all of the planned features I had when I started updating Clink ten months ago. So there will be less frequent updates now, and I anticipate they will mostly be minor bug updates.
What's new in v1.2.22:
clink-what-is
command bound by default to Alt+?, which shows the key binding for the next key sequence that is input.rl.getargument()
function to get the accumulated Readline numeric argument, if any. For use in "luafunc:" macros.clink-show-help
command now categorizes key bindings and shows a description for the commands. Using a numeric argument can control whether categorization and descriptions are used.clink-select-complete
while it is already active, so that it doesn't lose quotes around the current match if it has quotes.clink-show-help
to list "Enter" instead of "C-m" for the Enter key. Otherwise there's no way to differentiate between Enter and Ctrl+M when the terminal.differentiate_keys
setting is enabled.insert-comment
command, which accidentally fell back to inserting #
after the first prompt (that's what bash inserts, and shouldn't be used in Clink).dump-functions
command, which accidentally didn't list UTF8 key sequences correctly.Published by chrisant996 over 3 years ago
os.debugprint()
function to print debug text via the OS OutputDebugString()
API.clink-select-complete
command.clink-select-complete
command.clink-popup-complete
command.Published by chrisant996 over 3 years ago
clink-select-complete
command which shows an interactive list of possible completions.Published by chrisant996 over 3 years ago
clink installscripts
and clink uninstallscripts
.clink installscripts --help
.clink-popup-directories
for directories with spaces.⚠ Windows Defender is falsely detecting malware in the Clink installer; it has been reported to Windows Defender. ⚠
Workaround: in the meantime, try downloading the .zip file, as Windows Defender is happy with the Clink files themselves, just not with the installer program.
Clink is nearing a point where it will switch to only bug-fix updates for a while.
There are only two remaining known upcoming changes:
clink-select-complete
command that behaves similar to Ctrl+Space in Powershell (which will close #52).cmd.auto_answer
not working in German), depending on troubleshooting response.Published by chrisant996 over 3 years ago
clink-popup-show-help
command to show popup list with searchable list of key bindings and invoke the selected key binding.clink.popuplist()
function to show a popup list. Only usable from inside a "luafunc:" key binding.$
(regression introduced in v1.2.16).cmd.auto_answer
setting is enabled but an error occurs while retrieving a language string (might be related to #137).Published by chrisant996 over 3 years ago
clink.onendedit()
Lua event has been split into two separate events:
clink.onendedit()
registers a function to be called when the edit prompt ends.clink.onfilterinput()
registers a function to be called after the edit prompt ends (and after the onendedit event is sent), and the function can replace the input text.rl.getkeybindings()
function to get a table containing key bindings. The bindings can be invoked via rl.invokecommand()
. For example, a "luafunc:" macro could use this to get key bindings, show an interactive list, and then invoke the selected key binding.print()
can stop working. Issue #93 can potentially happen any time redirection is used, so the fix must be applied repeatedly (not just after Clink injection).Published by chrisant996 over 3 years ago
clink_start.cmd
from the binaries directory and/or the profile directory when Clink is injected.cmd.get_errorlevel
setting is off by default, but when enabled it retrieves the last exit code from CMD before running Lua scripts.os.geterrorlevel()
function gets the last exit code (or 0 if the setting is off).echo %errorlevel%
yourself every second command you type). If you experience problems with this, turn it off.Published by chrisant996 over 3 years ago
:
or =
; now completion works for the flag's argument.