Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clink breaks ConEmu-specific Escape codes #487

Open
DRSDavidSoft opened this issue Apr 22, 2018 · 5 comments
Open

Clink breaks ConEmu-specific Escape codes #487

DRSDavidSoft opened this issue Apr 22, 2018 · 5 comments

Comments

@DRSDavidSoft
Copy link

Some terminal emulators (such as ConEmu) have their own specific Escape Code sequence.

For example, ConEmu uses an extended set of commands explained in here which are caught when Cmd echo them.

However, Clink processes the escape sequences itself, and thus breaks ConEmu compatibility.

IMO, Clink should pass-through any escape sequence that it does not understand, so ConEmu could work as expected.

@chrisant996
Copy link

Commit 7b0e646 in the chrisant996 fork automatically passes all output (including escape codes) directly to the console when the console says it supports VT processing. There is a terminal.emulate setting to manually override the auto-detection and force VT emulation on (clink handles VT codes itself) or off (clink passes everything to the console).

@DRSDavidSoft
Copy link
Author

DRSDavidSoft commented Oct 12, 2020

@chrisant996 Nice job, I'll have a look later 👍 Awesome to see ENABLE_VIRTUAL_TERMINAL_PROCESSING being used in your fork for VT100 processing

P.S. is it possible to try and enable this flag for cmd.exe within Clink itself?
e.g.

GetConsoleMode(m_handle, &mode);
mode |= ENABLE_VIRTUAL_TERMINAL_PROCESSING;
SetConsoleMode(m_handle, mode);

@chrisant996
Copy link

It's possible, but why?
Why not use the existing ways that Windows has for that?
Windows 10 has it enabled by default for a while now.

@DRSDavidSoft
Copy link
Author

-- Not to get offtopic from this issue, but I think it would be appreciated on other platforms, where it's not enabled by default, for any reason. I feel like being able to use a settings for that would be useful.
Personally, I needed to resort to Powershell in the past when dealing with a program that outputted ESC sequence VT100 codes, but didn't enable the ENABLE_VIRTUAL_TERMINAL_PROCESSING flag itself (e.g. many Linux tools).
Yes, nowadays it may come pre-enabled in Windows 10 instances, but within my machine, I have needed to modify the registry as such to make it work:

REG ADD HKCU\CONSOLE /f /v VirtualTerminalLevel /t REG_DWORD /d 1

So, it'd be appreciated if calling clink from cmd.exe could also set this flag, if/when requested by the user.

That's my 2¢ though, feel free to implement any VT100-related attribute as you fit; the new terminal.emulate setting, as I understand, already solves the original issue -- and I believe any decision you make will be good too. I'm impressed with the amount of work and new changes in your fork!

@chrisant996
Copy link

chrisant996 commented Oct 12, 2020

would be appreciated on other platforms, where it's not enabled by default, for any reason
...
So, it'd be appreciated if calling clink from cmd.exe could also set this flag, if/when requested by the user.

Hm, yes, I thought it was possible to set a .LNK file to forcibly enable VT processing for its specific console instance, but that doesn't seem to be the case. There's only a way to control VT processing and other features for all console instances.

I've opened chrisant996 #8 for this.

Thanks for the suggestion and explanation!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants