[feature request] ANSI escape sequences in Viewer

Here you can propose new features, make suggestions etc.

Moderators: Hacker, petermad, Stefan2, white

Post Reply
M95D
Junior Member
Junior Member
Posts: 6
Joined: 2020-10-02, 17:04 UTC

[feature request] ANSI escape sequences in Viewer

Post 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.
Last edited by M95D on 2025-03-06, 16:33 UTC, edited 1 time in total.
User avatar
petermad
Power Member
Power Member
Posts: 15997
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: [feature request] ANSI escape sequences in Viewer

Post by *petermad »

2M95D

could the "ANSI viewer plugin" http://totalcmd.net/plugring/wlx_ans.html maybe do it for you?
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
M95D
Junior Member
Junior Member
Posts: 6
Joined: 2020-10-02, 17:04 UTC

Re: [feature request] ANSI escape sequences in Viewer

Post 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).
User avatar
white
Power Member
Power Member
Posts: 5743
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: [feature request] ANSI escape sequences in Viewer

Post by *white »

2M95D
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)
M95D
Junior Member
Junior Member
Posts: 6
Joined: 2020-10-02, 17:04 UTC

Re: [feature request] ANSI escape sequences in Viewer

Post by *M95D »

No, I'm not aware. I don't use Win10 for anything other than gaming and even that is very rare.
Post Reply