tview icon indicating copy to clipboard operation
tview copied to clipboard

ANSI - VT510 -> DECDHL—Double-Width, Double-Height Line - support.

Open matho53 opened this issue 9 months ago • 4 comments

I'm hoping to have the ability to use DECDHL, in a TUI application.

like this:

Image

But every time i try, the escape sequence is ignored...

sample code:

...
func fakeSearch(input int) string {
	return fmt.Sprintf("MATCHING\nRECORDS:\n\x1b#3%d\n\x1b#4%d", input, input)
	//return fmt.Sprintf("MATCHING\nRECORDS:\n%d", input)
}
...
	matchingRecordsBox := tview.NewTextView().
		SetText(fakeSearch(112)).
		SetTextAlign(tview.AlignCenter).
		//SetTextColor(tcell.ColorAqua).
		SetDynamicColors(true).
		SetMaxLines(4)
	matchingRecordsBox.SetBorder(true)
...

Image

See original vt510 documentation:- https://manx-docs.org/collections/mds-199909/cd3/term/vt510rmb.pdf -> pg 5-37

I can replicate DECDHL in Go using these options:

Image

*Note - Windows terminal released the feature in version v1.17.1023 See release notes and search for "DECDHL" -> https://github.com/microsoft/terminal/releases/tag/v1.17.1023

matho53 avatar Mar 24 '25 11:03 matho53

That's not how tview (or even tcell) works. Adding escape codes to a TextView will not have the intended effect. tview draws individual characters on the screen (using tcell). \x1b will just be treated like one such character. Because most fonts don't show anything for this character, it will just show up as an empty cell.

You could contact the maintainer of https://github.com/gdamore/tcell if he wants to support this mode. But I would not get my hopes up.

rivo avatar Mar 26 '25 17:03 rivo

Thanks Rivo, I'll follow your direction re: gdamore/tcell. I appreciate any time u took to look into, and your description makes perfect sense.

Also agree it might be a bit of an ask to get support for DECDHL :)

I'm trying my best to clone "The fugitive" TUI using tview... the hospital scene ~1:06 minutes in.

Image

Image

Getting close to replicating:

Image

matho53 avatar Mar 27 '25 09:03 matho53

To me, the screenshot doesn't look like an actual terminal application but rather like a photoshopped image shown on a CRT. The cells don't line up, the rows are unevenly distributed, and the highlighting doesn't look like any terminal would display it. From all I know about screen design in Hollywood, they don't usually program actual terminal software but use other visual design tools (e.g. Adobe After Effects).

There are a few blogs which collect these and try to figure out how they were done.

rivo avatar Mar 27 '25 12:03 rivo

You could be onto something "after affects" was released in 93.. film was released in 93... When i look at the footage it looks legit, but it could be just Hollywood.

https://github.com/user-attachments/assets/9664dc10-1136-4074-bb04-c046a00fe91d

matho53 avatar Mar 28 '25 13:03 matho53