Closed ben-may closed 1 year ago
See this code, and this global.
In order for Clink to detect when CMD is trying to print the prompt, Clink has to override the %PROMPT%
variable to something both predictable and unique.
Since launching programs inherits environment variables, launching other programs from a Clink window gets the tagged prompt value. Launching CMD instances from those other programs inherits the tagged prompt value as well.
When CMD prints the tagged prompt value, the "C\bL\bI\bN\bK\b
{original%PROMPT%value}" looks fine because the \b
(Backspace) characters backspace over the tag characters, and the prompt looks fine.
But if a program (like Visual Studio) redirects the terminal output and does custom drawing of the terminal output and doesn't handle \b
characters as doing a backspace, then the custom drawing will end up showing the "hidden" tag.
You could work around the issue by setting %PROMPT% inside the CMD shell launched inside Visual Studio.
There isn't a way for Clink to intercept the prompt without altering the prompt text.
I marked it "working as intended" -- but I want to be clear that I don't mean the side effects are desirable, only that they're unavoidable and are part of the designed behavior.
ah excellent thank-you for the explanation!
Hi,
I have a strange issue where when we launch Visual Studio from a clink command prompt, we see
being printed out before some of our bat files we launch/execute. I can't find anywhere in the clink code or anything we are doing where we try to print out
C\bL\b\I\bN\K\b \b
since the unknown characters are BS or backspace characters.Looking through the clink source I do see some things going on with \b being written out so perhaps it could be the culprit. since the letters are
CLINK
then I assume it must have something to do with clink.If we launch Visual Studio not from a clink command prompt the issue does not occur.
We are using CLINK 1.3.0.f070e4
Thanks!