Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

SOLVED: Request: @STRIPANSI[] function

OK, I had gotten rid of a couple things that didn't seem necessary here (Windows 10). I reinstated them and placed a new 4WT.ZIP on the server. Please try it and report.

copy ftp://vefatica.net/4plugins/x64/4wt.zip
 
It actually was smaller, but i had WT maximized.
But you're probably right that that's what it is.
 
Hey, I have a 4WT suggestion. Instead of CLEAR and FCLS, why not hook CLS and make /C and /S do what they're supposed to?
 
They're both easy enough. CLEAR writes ^e[2J^e[H and FCLS writes ^e[2J^e[3J^e[H. Some might like aliases (keystroke even) to do those.

But I could to that. My first thought is ... if either /C or /S is there, do it and remove it, and if there's anything left, send it to the built-in CLS.
 
You know, the [[BRIght] fg ON [BRIght] bg] part doesn't work very well in WT. After executing this command

1732658352799.webp


I'm here

1732658457361.webp


And when I execute another command,

1732658517792.webp
 
I remember seeing ugliness like the last pic above back in the 4DOS/ANSI.SYS days.
 
And you handle [[BRIght] fg ON [BRIght] bg] flawlessly! That's hard to believe.
 
That doesn't look very good. "foo" doesn't have a blue background and the padding isn't blue.

At the moment, WT has 20 color specs, a 16-color palette, default foreground, default background, cursor, and selection background. If you don't specify colors you get the defaults. I'm pretty sure TCC specifies its own idea of what's default, namely, a pair of colors from the 16-color palette.
 
The "foo" definitely has a blue background on mine.

As for the padding around the text, I expect there is probably an escape sequence to set it.
 
I thought 4WT already did things to fix cls somehow and that was my reason for getting it. I don't remember. Never heard of fcls either,

TCC's color commands and ANSI color changes work a bit differently with background colors. You get more control directly using ANSI sequences, but sometimes the TCC way is less typing to get the same effect.

Here is your *cls bright white on blue example on mine (using the preview version of Windows Terminal):

1732668479045.webp


But the same foreground/background set via ansi codes gets this (as designed):

1732668514052.webp
 
Hey, I have a 4WT suggestion. Instead of CLEAR and FCLS, why not hook CLS and make /C and /S do what they're supposed to?
I put ENABLEVT in 4WT.

At the moment I have

Code:
v:\> cls /?
clear viewport; with /S, scroll to clean viewport; with /C, clear all

It does not call the internal CLS for two reasons.

1. The internal CLS doesn't work well in WT
2. The internal CLS is always going to clear the viewport.

I can leave it as it is, give it another name, or remove it. What do you think?
 
Yea, i had to overload my cls with a BAT-alias in order to "Repeat 250 echo." and "echos %@CHAR[27][H%@CHAR[27][0J" prior to "*cls", because for example, if you set a line to double-height, it could get stuck that way, then you're only seeing the bottom/top half of characters and can't even read what you're typing (well, you can, but it's incredibly annoying to be stuck seeing only ½ of each letter haha).
 
Last edited:
I put ENABLEVT in 4WT.

At the moment I have

Code:
v:\> cls /?
clear viewport; with /S, scroll to clean viewport; with /C, clear all

It does not call the internal CLS for two reasons.

1. The internal CLS doesn't work well in WT
2. The internal CLS is always going to clear the viewport.

I can leave it as it is, give it another name, or remove it. What do you think?

You would lose the ability to change the viewport's colors. I don't know whether that matters to you or not.

I wonder why CLS isn't working in WT for you?
 
I wonder why CLS isn't working in WT for you?
And I wonder why it does work for you? Have you tried it with other WT color schemes?

I'd guess that TCC gets its default foreground/background from HLCU\Console\... . WT has its own, scheme-dependent, notion of those values. It seems that must sometimes cause trouble.

You would lose the ability to change the viewport's colors. I don't know whether that matters to you or not.

It doesn't matter to me. In WT, CLS doesn't seem to be a good way to change the colors, for reasons mentioned. You can change the WT color scheme and you can change any/all of the 20 colors with control sequences.

I have another alternative for a plugin CLS. If /S and/or /C appear, act on it and remove it (replace with spaces) and then call the internal CLS (by returning 0xFEDCBA98). The internal CLS clearing the viewport will do no harm if the plugin has already scrolled or cleared the whole buffer.

P.S., Yesterday, after considerable trouble, I built my own OpenConsole.exe. I'm hoping for help getting it to respect Windows light/dark mode (scroll bars are always white). The gents on GitHub/WT have alluded to a "branch" where that's discussed but they haven't been more forthcoming. Do you know what a "branch" is and how to search GitHub/WT for one?
 
And I wonder why it does work for you? Have you tried it with other WT color schemes?

I've tried a half dozen different schemes, with ANSI colors off and with ANSI colors on. I can't reproduce your issue. Are you maybe doing ANSI stuff in your prompt?

P.S., Yesterday, after considerable trouble, I built my own OpenConsole.exe. I'm hoping for help getting it to respect Windows light/dark mode (scroll bars are always white). The gents on GitHub/WT have alluded to a "branch" where that's discussed but they haven't been more forthcoming. Do you know what a "branch" is and how to search GitHub/WT for one?

Sorry; I am woefully ignorant of git. It's on my long list of things to learn... someday....
 
Are you maybe doing ANSI stuff in your prompt?
I certainly am.

Code:
v:\> set prompt
$e]9;9;"$P"$e\$e[92m$p$g$s$e[0m

And maybe it's the CSI 0 m telling WT (not TCC) to use default colors.

FWIW, the $e]9;9;"$P"$e\ tells WT what the current directory is. It's needed (at least was at one time) for WT to get the current directory right when duplicating a tab or pane.

The only thing I know about GitHub is how to visit the WT forum.
 
It’s gone now. Something fixed it somewhere. Probably you.
 
Back
Top