mirror of
https://github.com/cmderdev/cmder.git
synced 2025-02-14 09:20:21 +08:00
commit
c34eb73555
10
CHANGELOG.md
10
CHANGELOG.md
@ -1,7 +1,15 @@
|
|||||||
# Change Log
|
# Change Log
|
||||||
|
|
||||||
## [1.3.17](https://github.com/cmderdev/cmder/tree/v1.3.17) (2020-12-23)
|
## [1.3.18](https://github.com/cmderdev/cmder/tree/v1.3.18) (2021-3-26)
|
||||||
|
|
||||||
|
### Changes
|
||||||
|
|
||||||
|
- Update to Clink 1.1.45 to fix #2451, #2465, and #2473
|
||||||
|
- Update to ConEmu v21.03.04
|
||||||
|
- `init.bat` auto migrates the history alias to use `clink history` if required.
|
||||||
|
- Remove Tilde match from clink.lua in favor of builtin Clink capability.
|
||||||
|
|
||||||
|
## [1.3.17](https://github.com/cmderdev/cmder/tree/v1.3.17) (2020-12-23)
|
||||||
### Fixes
|
### Fixes
|
||||||
|
|
||||||
- [bug] Running `alias ..=cd ..` removes other aliases #2394
|
- [bug] Running `alias ..=cd ..` removes other aliases #2394
|
||||||
|
10
vendor/bin/alias.cmd
vendored
10
vendor/bin/alias.cmd
vendored
@ -81,9 +81,6 @@ set alias_name=!alias_name:~1!
|
|||||||
:: trailing quotes added while validating
|
:: trailing quotes added while validating
|
||||||
set alias_value=!alias_value:~0,-1!
|
set alias_value=!alias_value:~0,-1!
|
||||||
|
|
||||||
:: '.' escaped
|
|
||||||
set alias_name_esc=!alias_name:.=\.!
|
|
||||||
|
|
||||||
::remove spaces
|
::remove spaces
|
||||||
set _temp=%alias_name: =%
|
set _temp=%alias_name: =%
|
||||||
|
|
||||||
@ -94,7 +91,7 @@ if not ["%_temp%"] == ["%alias_name%"] (
|
|||||||
)
|
)
|
||||||
|
|
||||||
:: replace already defined alias
|
:: replace already defined alias
|
||||||
%WINDIR%\System32\findstr /v /i "^%alias_name_esc%=" "%ALIASES%" >> "%ALIASES%.tmp"
|
%WINDIR%\System32\findstr /b /l /v /i "%alias_name%=" "%ALIASES%" >> "%ALIASES%.tmp"
|
||||||
echo %alias_name%=%alias_value% >> "%ALIASES%.tmp" && type "%ALIASES%.tmp" > "%ALIASES%" & @del /f /q "%ALIASES%.tmp"
|
echo %alias_name%=%alias_value% >> "%ALIASES%.tmp" && type "%ALIASES%.tmp" > "%ALIASES%" & @del /f /q "%ALIASES%.tmp"
|
||||||
doskey /macrofile="%ALIASES%"
|
doskey /macrofile="%ALIASES%"
|
||||||
endlocal
|
endlocal
|
||||||
@ -103,10 +100,7 @@ exit /b
|
|||||||
:p_del
|
:p_del
|
||||||
set del_alias=%~1
|
set del_alias=%~1
|
||||||
|
|
||||||
:: '.' escaped
|
%WINDIR%\System32\findstr /b /l /v /i "%del_alias%=" "%ALIASES%" >> "%ALIASES%.tmp"
|
||||||
set del_alias_esc=!del_alias:.=\.!
|
|
||||||
|
|
||||||
%WINDIR%\System32\findstr /v /i "^%del_alias_esc%=" "%ALIASES%" >> "%ALIASES%.tmp"
|
|
||||||
type "%ALIASES%".tmp > "%ALIASES%" & @del /f /q "%ALIASES%.tmp"
|
type "%ALIASES%".tmp > "%ALIASES%" & @del /f /q "%ALIASES%.tmp"
|
||||||
doskey %del_alias%=
|
doskey %del_alias%=
|
||||||
doskey /macrofile="%ALIASES%"
|
doskey /macrofile="%ALIASES%"
|
||||||
|
17
vendor/clink.lua
vendored
17
vendor/clink.lua
vendored
@ -406,24 +406,7 @@ local function svn_prompt_filter()
|
|||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
local function tilde_match (text, f, l)
|
|
||||||
if text == '~' then
|
|
||||||
clink.add_match(clink.get_env('userprofile'))
|
|
||||||
clink.matches_are_files()
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
|
|
||||||
if text:sub(1, 1) == '~' then
|
|
||||||
clink.add_match(string.gsub(text, "~", clink.get_env('userprofile'), 1))
|
|
||||||
-- second match prevents adding a space so we can look for more matches
|
|
||||||
clink.add_match(string.gsub(text, "~", clink.get_env('userprofile'), 1) .. '+')
|
|
||||||
clink.matches_are_files()
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- insert the set_prompt at the very beginning so that it runs first
|
-- insert the set_prompt at the very beginning so that it runs first
|
||||||
clink.register_match_generator(tilde_match, 1)
|
|
||||||
clink.prompt.register_filter(set_prompt_filter, 1)
|
clink.prompt.register_filter(set_prompt_filter, 1)
|
||||||
clink.prompt.register_filter(hg_prompt_filter, 50)
|
clink.prompt.register_filter(hg_prompt_filter, 50)
|
||||||
clink.prompt.register_filter(git_prompt_filter, 50)
|
clink.prompt.register_filter(git_prompt_filter, 50)
|
||||||
|
123
vendor/clink_settings.default
vendored
123
vendor/clink_settings.default
vendored
@ -1,116 +1,19 @@
|
|||||||
# name: Pressing Ctrl-D exits session
|
# For explanation of these and other settings see:
|
||||||
# type: bool
|
# https://chrisant996.github.io/clink/clink.html
|
||||||
# Ctrl-D exits cmd.exe when it is pressed on an empty line.
|
|
||||||
ctrld_exits = 1
|
|
||||||
|
|
||||||
# name: Toggle if pressing Esc clears line
|
|
||||||
# type: bool
|
|
||||||
# Clink clears the current line when Esc is pressed (unless Readline's Vi mode
|
|
||||||
# is enabled).
|
|
||||||
esc_clears_line = 1
|
|
||||||
|
|
||||||
# name: Match display colour
|
|
||||||
# type: int
|
|
||||||
# Colour to use when displaying matches. A value less than 0 will be the
|
|
||||||
# opposite brightness of the default colour.
|
|
||||||
match_colour = -1
|
|
||||||
|
|
||||||
# name: Executable match style
|
|
||||||
# type: enum
|
|
||||||
# 0 = PATH only
|
|
||||||
# 1 = PATH and CWD
|
|
||||||
# 2 = PATH, CWD, and directories
|
|
||||||
# Changes how Clink will match executables when there is no path separator on
|
|
||||||
# the line. 0 = PATH only, 1 = PATH and CWD, 2 = PATH, CWD, and directories. In
|
|
||||||
# all cases both executables and directories are matched when there is a path
|
|
||||||
# separator present. A value of -1 will disable executable matching completely.
|
|
||||||
exec_match_style = 2
|
|
||||||
|
|
||||||
# name: Whitespace prefix matches files
|
|
||||||
# type: bool
|
|
||||||
# If the line begins with whitespace then Clink bypasses executable matching and
|
|
||||||
# will match all files and directories instead.
|
|
||||||
space_prefix_match_files = 1
|
|
||||||
|
|
||||||
# name: Colour of the prompt
|
|
||||||
# type: int
|
|
||||||
# Surrounds the prompt in ANSI escape codes to set the prompt's colour. Disabled
|
|
||||||
# when the value is less than 0.
|
|
||||||
prompt_colour = -1
|
|
||||||
|
|
||||||
# name: Auto-answer terminate prompt
|
|
||||||
# type: enum
|
|
||||||
# 0 = Disabled
|
|
||||||
# 1 = Answer 'Y'
|
|
||||||
# 2 = Answer 'N'
|
|
||||||
# Automatically answers cmd.exe's 'Terminate batch job (Y/N)?' prompts. 0 =
|
|
||||||
# disabled, 1 = answer 'Y', 2 = answer 'N'.
|
|
||||||
terminate_autoanswer = 0
|
|
||||||
|
|
||||||
# name: Lines of history saved to disk
|
|
||||||
# type: int
|
|
||||||
# When set to a positive integer this is the number of lines of history that
|
|
||||||
# will persist when Clink saves the command history to disk. Use 0 for infinite
|
|
||||||
# lines and <0 to disable history persistence.
|
|
||||||
history_file_lines = 10000
|
|
||||||
|
|
||||||
# name: Skip adding lines prefixed with whitespace
|
|
||||||
# type: bool
|
|
||||||
# Ignore lines that begin with whitespace when adding lines in to the history.
|
|
||||||
history_ignore_space = 0
|
|
||||||
|
|
||||||
# name: Controls how duplicate entries are handled
|
|
||||||
# type: enum
|
|
||||||
# 0 = Always add
|
|
||||||
# 1 = Ignore
|
|
||||||
# 2 = Erase previous
|
|
||||||
# If a line is a duplicate of an existing history entry Clink will erase the
|
|
||||||
# duplicate when this is set 2. A value of 1 will not add duplicates to the
|
|
||||||
# history and a value of 0 will always add lines. Note that history is not
|
|
||||||
# deduplicated when reading/writing to disk.
|
|
||||||
history_dupe_mode = 2
|
|
||||||
|
|
||||||
# name: Read/write history file each line edited
|
|
||||||
# type: bool
|
|
||||||
# When non-zero the history will be read from disk before editing a new line and
|
|
||||||
# written to disk afterwards.
|
|
||||||
history_io = 1
|
|
||||||
|
|
||||||
# name: Sets how command history expansion is applied
|
# name: Sets how command history expansion is applied
|
||||||
# type: enum
|
# type: enum
|
||||||
# 0 = Off
|
# options: off,on,not_squoted,not_dquoted,not_quoted
|
||||||
# 1 = On
|
history.expand_mode = not_dquoted
|
||||||
# 2 = Not in single quotes
|
|
||||||
# 3 = Not in double quote
|
|
||||||
# 4 = Not in any quotes
|
|
||||||
# The '!' character in an entered line can be interpreted to introduce words
|
|
||||||
# from the history. This can be enabled and disable by setting this value to 1
|
|
||||||
# or 0. Values or 2, 3 or 4 will skip any ! character quoted in single, double,
|
|
||||||
# or both quotes respectively.
|
|
||||||
history_expand_mode = 3
|
|
||||||
|
|
||||||
# name: Support Windows' Ctrl-Alt substitute for AltGr
|
# name: Skip adding lines prefixed with whitespace
|
||||||
# type: bool
|
# type: boolean
|
||||||
# Windows provides Ctrl-Alt as a substitute for AltGr, historically to support
|
history.ignore_space = False
|
||||||
# keyboards with no AltGr key. This may collide with some of Readline's
|
|
||||||
# bindings.
|
|
||||||
use_altgr_substitute = 1
|
|
||||||
|
|
||||||
# name: Strips CR and LF chars on paste
|
# name: The number of history lines to save
|
||||||
# type: enum
|
# type: integer
|
||||||
# 0 = Paste unchanged
|
history.max_lines = 10000
|
||||||
# 1 = Strip
|
|
||||||
# 2 = As space
|
|
||||||
# Setting this to a value >0 will make Clink strip CR and LF characters from
|
|
||||||
# text pasted into the current line. Set this to 1 to strip all newline
|
|
||||||
# characters and 2 to replace them with a space.
|
|
||||||
strip_crlf_on_paste = 2
|
|
||||||
|
|
||||||
# name: Enables basic ANSI escape code support
|
|
||||||
# type: bool
|
|
||||||
# When printing the prompt, Clink has basic built-in support for SGR ANSI escape
|
|
||||||
# codes to control the text colours. This is automatically disabled if a third
|
|
||||||
# party tool is detected that also provides this facility. It can also be
|
|
||||||
# disabled by setting this to 0.
|
|
||||||
ansi_code_support = 1
|
|
||||||
|
|
||||||
|
# name: Share history between instances
|
||||||
|
# type: boolean
|
||||||
|
history.shared = True
|
||||||
|
42
vendor/init.bat
vendored
42
vendor/init.bat
vendored
@ -148,18 +148,39 @@ if "%CMDER_CLINK%" == "1" (
|
|||||||
|
|
||||||
:: Run clink
|
:: Run clink
|
||||||
if defined CMDER_USER_CONFIG (
|
if defined CMDER_USER_CONFIG (
|
||||||
if not exist "%CMDER_USER_CONFIG%\settings" (
|
if not exist "%CMDER_USER_CONFIG%\settings" if not exist "%CMDER_USER_CONFIG%\clink_settings" (
|
||||||
echo Generating clink initial settings in "%CMDER_USER_CONFIG%\settings"
|
echo Generating clink initial settings in "%CMDER_USER_CONFIG%\clink_settings"
|
||||||
copy "%CMDER_ROOT%\vendor\clink_settings.default" "%CMDER_USER_CONFIG%\settings"
|
copy "%CMDER_ROOT%\vendor\clink_settings.default" "%CMDER_USER_CONFIG%\clink_settings"
|
||||||
echo Additional *.lua files in "%CMDER_USER_CONFIG%" are loaded on startup.\
|
echo Additional *.lua files in "%CMDER_USER_CONFIG%" are loaded on startup.
|
||||||
|
)
|
||||||
|
|
||||||
|
REM Cleanup lagacy Clink Settings file
|
||||||
|
if exist "%CMDER_USER_CONFIG%\settings" if exist "%CMDER_USER_CONFIG%\clink_settings" (
|
||||||
|
del "%CMDER_USER_CONFIG%\settings"
|
||||||
|
)
|
||||||
|
|
||||||
|
REM Cleanup legacy CLink history file
|
||||||
|
if exist "%CMDER_USER_CONFIG%\.history" if exist "%CMDER_USER_CONFIG%\clink_history" (
|
||||||
|
del "%CMDER_USER_CONFIG%\.history"
|
||||||
)
|
)
|
||||||
"%CMDER_ROOT%\vendor\clink\clink_%clink_architecture%.exe" inject --quiet --profile "%CMDER_USER_CONFIG%" --scripts "%CMDER_ROOT%\vendor"
|
"%CMDER_ROOT%\vendor\clink\clink_%clink_architecture%.exe" inject --quiet --profile "%CMDER_USER_CONFIG%" --scripts "%CMDER_ROOT%\vendor"
|
||||||
) else (
|
) else (
|
||||||
if not exist "%CMDER_ROOT%\config\settings" (
|
if not exist "%CMDER_ROOT%\config\settings" if not exist "%CMDER_ROOT%\config\clink_settings" (
|
||||||
echo Generating clink initial settings in "%CMDER_ROOT%\config\settings"
|
echo Generating clink initial settings in "%CMDER_ROOT%\config\clink_settings"
|
||||||
copy "%CMDER_ROOT%\vendor\clink_settings.default" "%CMDER_ROOT%\config\settings"
|
copy "%CMDER_ROOT%\vendor\clink_settings.default" "%CMDER_ROOT%\config\clink_settings"
|
||||||
echo Additional *.lua files in "%CMDER_ROOT%\config" are loaded on startup.
|
echo Additional *.lua files in "%CMDER_ROOT%\config" are loaded on startup.
|
||||||
)
|
)
|
||||||
|
|
||||||
|
REM Cleanup lagacy Clink Settings file
|
||||||
|
if exist "%CMDER_ROOT%\config\settings" if exist "%CMDER_ROOT%\config\clink_settings" (
|
||||||
|
del "%CMDER_ROOT%\config\settings"
|
||||||
|
)
|
||||||
|
|
||||||
|
REM Cleanup legacy Clink history file
|
||||||
|
if exist "%CMDER_ROOT%\config\.history" if exist "%CMDER_ROOT%\config\clink_history" (
|
||||||
|
del "%CMDER_ROOT%\config\.history"
|
||||||
|
)
|
||||||
|
|
||||||
"%CMDER_ROOT%\vendor\clink\clink_%clink_architecture%.exe" inject --quiet --profile "%CMDER_ROOT%\config" --scripts "%CMDER_ROOT%\vendor"
|
"%CMDER_ROOT%\vendor\clink\clink_%clink_architecture%.exe" inject --quiet --profile "%CMDER_ROOT%\config" --scripts "%CMDER_ROOT%\vendor"
|
||||||
)
|
)
|
||||||
) else (
|
) else (
|
||||||
@ -346,6 +367,13 @@ if "%CMDER_ALIASES%" == "1" (
|
|||||||
)
|
)
|
||||||
|
|
||||||
:: Add aliases to the environment
|
:: Add aliases to the environment
|
||||||
|
type "%user_aliases%" | findstr /b /l /i "history=cat " >nul
|
||||||
|
if "%ERRORLEVEL%" == "0" (
|
||||||
|
echo Migrating alias 'history' to new Clink 1.x.x...
|
||||||
|
call "%CMDER_ROOT%\vendor\bin\alias.cmd" /d history
|
||||||
|
echo Restart the session to activate changes!
|
||||||
|
)
|
||||||
|
|
||||||
call "%user_aliases%"
|
call "%user_aliases%"
|
||||||
|
|
||||||
if "%CMDER_CONFIGURED%" gtr "1" goto CMDER_CONFIGURED
|
if "%CMDER_CONFIGURED%" gtr "1" goto CMDER_CONFIGURED
|
||||||
|
23
vendor/lib/lib_path.cmd
vendored
23
vendor/lib/lib_path.cmd
vendored
@ -112,13 +112,30 @@ exit /b
|
|||||||
|
|
||||||
:end_enhance_path
|
:end_enhance_path
|
||||||
set "PATH=%PATH:;;=;%"
|
set "PATH=%PATH:;;=;%"
|
||||||
if NOT "%OLD_PATH%" == "%PATH%" (
|
|
||||||
|
REM echo %path%|"C:\Users\dgames\cmder - dev\vendor\git-for-windows\usr\bin\wc" -c
|
||||||
|
if "%fast_init%" == "1" exit /b
|
||||||
|
|
||||||
|
if not "%OLD_PATH:~0,3000%" == "%OLD_PATH:~0,3001%" goto :toolong
|
||||||
|
if not "%OLD_PATH%" == "%PATH%" goto :changed
|
||||||
|
exit /b
|
||||||
|
|
||||||
|
:toolong
|
||||||
|
echo %OLD_PATH%>tempfileA
|
||||||
|
echo %PATH%>tempfileB
|
||||||
|
fc /b tempfileA tempfileB 2>nul 1>nul
|
||||||
|
if errorlevel 1 ( del tempfileA & del tempfileB & goto :changed )
|
||||||
|
del tempfileA & del tempfileB
|
||||||
|
exit /b
|
||||||
|
|
||||||
|
:changed
|
||||||
%print_debug% :enhance_path "END Env Var - PATH=%path%"
|
%print_debug% :enhance_path "END Env Var - PATH=%path%"
|
||||||
%print_debug% :enhance_path "Env Var %find_query% - found=%found%"
|
%print_debug% :enhance_path "Env Var %find_query% - found=%found%"
|
||||||
)
|
exit /b
|
||||||
set "position="
|
|
||||||
exit /b
|
exit /b
|
||||||
|
|
||||||
|
|
||||||
:set_found
|
:set_found
|
||||||
if "%ERRORLEVEL%" == "0" (
|
if "%ERRORLEVEL%" == "0" (
|
||||||
set found=1
|
set found=1
|
||||||
|
8
vendor/sources.json
vendored
8
vendor/sources.json
vendored
@ -6,13 +6,13 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "clink",
|
"name": "clink",
|
||||||
"version": "1.1.10",
|
"version": "1.1.45",
|
||||||
"url": "https://github.com/chrisant996/clink/releases/download/v1.1.10/clink.1.1.10.125c9f.zip"
|
"url": "https://github.com/chrisant996/clink/releases/download/v1.1.45/clink.1.1.45.1c3985.zip"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "conemu-maximus5",
|
"name": "conemu-maximus5",
|
||||||
"version": "191012",
|
"version": "210304",
|
||||||
"url": "https://github.com/Maximus5/ConEmu/releases/download/v19.10.12/ConEmuPack.191012.7z"
|
"url": "https://github.com/Maximus5/ConEmu/releases/download/v21.03.04/ConEmuPack.210304.7z"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "clink-completions",
|
"name": "clink-completions",
|
||||||
|
1
vendor/user_aliases.cmd.default
vendored
1
vendor/user_aliases.cmd.default
vendored
@ -9,7 +9,6 @@ gl=git log --oneline --all --graph --decorate $*
|
|||||||
ls=ls --show-control-chars -F --color $*
|
ls=ls --show-control-chars -F --color $*
|
||||||
pwd=cd
|
pwd=cd
|
||||||
clear=cls
|
clear=cls
|
||||||
history=cat -n "%CMDER_ROOT%\config\.history"
|
|
||||||
unalias=alias /d $1
|
unalias=alias /d $1
|
||||||
vi=vim $*
|
vi=vim $*
|
||||||
cmderr=cd /d "%CMDER_ROOT%"
|
cmderr=cd /d "%CMDER_ROOT%"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user