-
Rather than a feature, I have a question regarding both Terminal and Is there a way to make the terminal emit CRLF through ANSI escape sequences? Use-case: we (in a thread here) are trying to create a customizable prompt for Example PoC should that be necessary: @setlocal DisableDelayedExpansion & echo off
for /f "skip=1" %%e in ('"echo(prompt $E| "%ComSpec%" /d /q /k 2>nul"') do (
set "\e=%%~e"
)
"%windir%\System32\doskey.exe" %\e%[?1;0c = echo ...
set PROMPT=$E[0c$P$G$S ... |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
No. Modern terminals tend to avoid escape sequences that can be used to generate key presses because they are something of a security risk. For example, imagine you were trying to view a readme file in the console, and that file had an embedded escape sequence that injected the keystrokes for a command that would delete all of your files. You would not be happy. Also, it's worth mentioning that the |
Beta Was this translation helpful? Give feedback.
No. Modern terminals tend to avoid escape sequences that can be used to generate key presses because they are something of a security risk. For example, imagine you were trying to view a readme file in the console, and that file had an embedded escape sequence that injected the keystrokes for a command that would delete all of your files. You would not be happy.
Also, it's worth mentioning that the
DA
sequence won't always return\x1b[?1;0c
. It's used to identify the terminal's capabilities, and we've progressed a lot since that document was written. Newer versions of the console will return something quite dif…