~aleteoryx/ntalk

b1dc9065fc7f47b751a186a10858dc53b1135fbd — Aleteoryx 2 months ago 0df328a
colorized sixels
1 files changed, 8 insertions(+), 4 deletions(-)

M ntalk.tcl
M ntalk.tcl => ntalk.tcl +8 -4
@@ 92,6 92,7 @@ proc splitsixels {str} {
	foreach c [split $str {}] {
		switch -regexp -- $c {
			- {
				set row [string trimright $row "? "]
				lappend ret $row
				set row {}
			}


@@ 149,6 150,8 @@ proc sixels2image {sixels} {
	}

	set image [image create bitmap -data $xbm]
	image create bitmap motd$image -data $xbm -foreground DarkOliveGreen
	image create bitmap mention$image -data $xbm -foreground DarkOrchid4
	dict set images "sixel:$sixels" $image
	dict set images "xbm:$xbm" $image
	dict set images "image:$image" $sixels


@@ 247,10 250,10 @@ menu .menu.sixels.rm -tearoff 0

.menu add cascade -label "ntalk" -menu .menu.nt
.menu.nt add command -label "about ntalk" -command {
	tk_dialog .about "about ntalk" \
		"ntalk\nby aleteoryx\nlast updated 2025-09-20" \
		"info" \
		0 okay
	tk_messageBox -title "about ntalk" \
		-message "ntalk\nby aleteoryx" \
		-detail "last updated 2025-09-21" \
		-icon "info"
}
.menu.nt add separator
.menu.nt add command -label "restart" -command restart -accelerator "Ctrl-Shift-R"


@@ 516,6 519,7 @@ proc bufpush {line} {

		if {$image != {}} {
			lassign $image raw image
			set image $tag$image
			.buffer insert end $raw [concat rawsixel $tag]
			.buffer image create end -image $image
			.buffer tag add $tag {end -1 chars}