Skip to content

Commit

Permalink
update clink
Browse files Browse the repository at this point in the history
  • Loading branch information
mysterywolf committed Apr 28, 2024
1 parent d895cd7 commit e2a0d8d
Show file tree
Hide file tree
Showing 12 changed files with 197 additions and 39 deletions.
69 changes: 69 additions & 0 deletions tools/ConEmu/ConEmu/clink/CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,75 @@

### Releases from [chrisant996/clink](https://github.com/chrisant996/clink) fork

#### v1.6.12

- Fixed [#597](https://github.com/chrisant996/clink/issues/597); prompt shows leftover text sometimes (regression introduced in v1.6.10).
- Fixed [#596](https://github.com/chrisant996/clink/issues/596); it's easy to forget whether <kbd>Enter</kbd> in history list executes or inserts.

#### v1.6.11

- Added `os.setalias()` for setting a doskey alias without needing to invoke the doskey.exe program.
- Fixed a case where match descriptions could be displayed with incorrect padding and truncation.
- Lua debugging enhancements:
- Changed the built-in embedded scripts to include debug info, which allows some Lua error messages to be more useful for troubleshooting.
- Added `srcmap` command in the Lua debugger to override where to find source files.

#### v1.6.10

- Added an optimization to further reduce flicker when re-drawing the prompt.
- Added a `user_data.shared_user_data` table to allow linked argmatchers to share data with each other while an input line is being parsed (see [Responding to Arguments in Argmatchers](https://chrisant996.github.io/clink/clink.html#responsive-argmatchers) for details).
- Fixed [#579](https://github.com/chrisant996/clink/issues/579); popup lists could accidentally truncate text in the first column when there's only one column.
- Fixed [#576](https://github.com/chrisant996/clink/issues/576); setup exe doesn't remove old uninstall exe files.
- Fixed [#575](https://github.com/chrisant996/clink/issues/575); error when `color.executable` is set and `color.unrecognized` is not (regression introduced in v1.6.2).

#### v1.6.9

- Fixed [#574](https://github.com/chrisant996/clink/issues/574); `prompt.spacing` "eats" lines containing Unicode Surrogate Pairs such as for some [nerdfont](https://nerdfonts.com) icons (Windows Terminal accidentally returns that such lines are empty).
- Fixed [#573](https://github.com/chrisant996/clink/issues/573); C# was unable to read Clink's version resource.
- Fixed [#555](https://github.com/chrisant996/clink/issues/555); security advisory [CVE-2020-24370](https://github.com/advisories/GHSA-gfr4-c37g-mm3v) for a Lua bug.

#### v1.6.8

- Fixed [#571](https://github.com/chrisant996/clink/issues/571); error in clink.bat under some circumstances (regression introduced in v1.6.7).

#### v1.6.7

- Recognize the little-known `cmd /r` as a synonym for `cmd /c` so that Clink can optimize and skip injecting into a `cmd /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 when `exec.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](https://github.com/chrisant996/clink/issues/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 the `history.time_stamp` setting is `show`.
- 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](https://github.com/chrisant996/clink/issues/569); `cmd /e:off` causes syntax error in clink.bat script.
- Fixed [#567](https://github.com/chrisant996/clink/issues/567); `clink history compact` accidentally deletes all timestamps.
- Fixed documentation error in Lua API Reference about `"w"` mode in `io.open()` and `io.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.

#### v1.6.4

- Added `rl_buffer:hassuggestion()` and `rl_buffer:insertsuggestion()` for direct access to inserting suggestions without invoking Readline commands.
- Added `clink.dirmatchesexact()` and `clink.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 the `exec.enable` setting is enabled.
- Fixed applying `colored-completion-prefix` when match display filtering is active or a match has a custom `display` 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](https://github.com/chrisant996/clink/issues/562); `clink autorun install` strips quotes by mistake.

#### v1.6.3

- **Breaking Change:** For the four <kbd>Ctrl</kbd>-<kbd>-</kbd> key combinations, Clink got the <kbd>Shift</kbd> key backwards and generated inaccurate input codes. And that broke the Readline/bash default key binding for `undo` (the Windows default key binding of <kbd>Ctrl</kbd>-<kbd>z</kbd> works fine). If your .inputrc file has bindings for any of the <kbd>Ctrl</kbd>-<kbd>-</kbd> 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`](#if_clink_version) syntax in your .inputrc file to make it define the key bindings differently in different versions of Clink.
Expand Down
35 changes: 18 additions & 17 deletions tools/ConEmu/ConEmu/clink/clink.bat
Original file line number Diff line number Diff line change
@@ -1,63 +1,64 @@
:: Copyright (c) 2012 Martin Ridgers
:: License: http://opensource.org/licenses/MIT

@echo off
rem -- Copyright (c) 2012 Martin Ridgers
rem -- Portions Copyright (c) 2020-2024 Christopher Antos
rem -- License: http://opensource.org/licenses/MIT

setlocal enableextensions
set clink_profile_arg=
set clink_quiet_arg=

:: Mimic cmd.exe's behaviour when starting from the start menu.
rem -- Mimic cmd.exe's behaviour when starting from the start menu.
if /i "%~1"=="startmenu" (
cd /d "%userprofile%"
shift
)

:: Check for the --profile option.
rem -- Check for the --profile option.
if /i "%~1"=="--profile" (
set clink_profile_arg=--profile "%~2"
shift
shift
)

:: Check for the --quiet option.
rem -- Check for the --quiet option.
if /i "%~1"=="--quiet" (
set clink_quiet_arg= --quiet
shift
)

:: If the .bat is run without any arguments, then start a cmd.exe instance.
rem -- If the .bat is run without any arguments, then start a cmd.exe instance.
if _%1==_ (
call :launch
goto :end
)

:: Test for autorun.
rem -- Test for autorun.
if defined CLINK_NOAUTORUN if /i "%~1"=="inject" if /i "%~2"=="--autorun" goto :end

:: Endlocal before inject tags the prompt.
endlocal

:: Pass through to appropriate loader.
rem -- Forward to appropriate loader, and endlocal before inject tags the prompt.
if /i "%processor_architecture%"=="x86" (
endlocal
"%~dp0\clink_x86.exe" %*
) else if /i "%processor_architecture%"=="arm64" (
endlocal
"%~dp0\clink_arm64.exe" %*
) else if /i "%processor_architecture%"=="amd64" (
if defined processor_architew6432 (
endlocal
"%~dp0\clink_x86.exe" %*
) else (
endlocal
"%~dp0\clink_x64.exe" %*
)
)

:end
goto :eof
goto :end

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:launch
setlocal
setlocal enableextensions
set WT_PROFILE_ID=
set WT_SESSION=
start "Clink" cmd.exe /s /k ""%~dpnx0" inject %clink_profile_arg%%clink_quiet_arg%"
endlocal
exit /b 0

:end
Loading

0 comments on commit e2a0d8d

Please sign in to comment.