Page 1 of 1
[feature request] ANSI escape sequences in Viewer
Posted: 2025-03-05, 18:45 UTC
by M95D
Hi.
I have a feature request:
Support ANSI escape sequences in Viewer. At least the color codes would be nice to have.
Why:
I use the file viewer to view linux logs. Sometimes, logs are just terminal ouput redirected to a file and many programs, especially gcc & clang, use color codes in output. This makes the file difficult to read with a simple text viewer. Selecting and copying text from the file to paste in a web page (bug report) is also difficult.
Thank you.
Re: [feature request] ANSI escape sequences in Viewer
Posted: 2025-03-06, 00:57 UTC
by petermad
2
M95D
could the "ANSI viewer plugin"
http://totalcmd.net/plugring/wlx_ans.html maybe do it for you?
Re: [feature request] ANSI escape sequences in Viewer
Posted: 2025-03-06, 16:30 UTC
by M95D
No. That plugin generates an image from text. It does have colors, etc., but the width is fixed at 80 characters and longer lines are truncated. Also, being just an image, text can't be selected for copy/paste. And it only works if the extension is ".ans". I see no way to "call" the plugin while viewing an ordinary text file (.txt or .log).
Re: [feature request] ANSI escape sequences in Viewer
Posted: 2025-03-06, 17:04 UTC
by white
2
M95D
Not what you asked, but are you aware that recent Windows 10 versions and later have native support for ANSI/VT100 escape sequences directly in the Windows Console Host (conhost.exe), which powers cmd.exe? So perhaps a button like this is useful to you:
Code: Select all
TOTALCMD#BAR#DATA
wt.exe --title "Show File" -p "Command Prompt" "%comspec%" /k type
%P%N & echo. & pause & exit
%comspec%
Show File in Command Prompt | |(use Ctrl+Shift+F to find, Ctrl+Shift+Home/End/PgUp/PgDn/Up/Down to navigate)
-1
Be aware of history buffer though (nowadays defaults to 9001 lines and has a max value of 32767).
(I used parameter /k so you can also drag a file onto the button)
Re: [feature request] ANSI escape sequences in Viewer
Posted: 2025-03-07, 19:46 UTC
by M95D
No, I'm not aware. I don't use Win10 for anything other than gaming and even that is very rare.