Skip to content

Commit

Permalink
Fix inject.
Browse files Browse the repository at this point in the history
`setlocal`/`endlocal` must be scoped carefully otherwise they'll revert
the tagged prompt and prevent Clink from detecting when the prompt is
shown.

If that gets reported as a problem in some other scenario, then perhaps
Clink could more aggressively retag the prompt.  But for now, the
mitigation will only be in the `clink.bat` script.
  • Loading branch information
chrisant996 committed Oct 15, 2022
1 parent 41197e3 commit d5796b9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion clink/app/src/loader/clink.bat
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ if "%1"=="" (
:: 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.
if /i "%processor_architecture%"=="x86" (
"%~dp0\clink_x86.exe" %*
Expand All @@ -46,7 +49,6 @@ if /i "%processor_architecture%"=="x86" (
)

:end
endlocal
goto :eof

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Expand Down

0 comments on commit d5796b9

Please sign in to comment.