#normalize 8bit to a token of the same length so our string operations on the code are the same and we can maintain a switch statement with literals rather than escapes
#normalize 8bit to a token of the same length so our string operations on the code are the same and we can maintain a switch statement with literals rather than escapes
#.. but preserve original c
#.. but preserve original c
set cnorm [string map [list \x9b {8[} ] $c]
#set cnorm [string map [list \x9b {8[} ] $c]
switch -- [string index $cnorm 1][string index $cnorm end] {
#switch -- [string index $cnorm 1][string index $cnorm end] {}
{[m} {
# {[m}
set params [string range $cnorm 2 end-1] ;#strip leading esc lb and trailing m
#has_sgr_reset - rather than support this function - create an sgr normalize function that removes dead params and brings reset to front of param list?
#has_sgr_reset - rather than support this function - create an sgr normalize function that removes dead params and brings reset to front of param list?
#normalize 8bit to a token of the same length so our string operations on the code are the same and we can maintain a switch statement with literals rather than escapes
#normalize 8bit to a token of the same length so our string operations on the code are the same and we can maintain a switch statement with literals rather than escapes
#.. but preserve original c
#.. but preserve original c
set cnorm [string map [list \x9b {8[} ] $c]
#set cnorm [string map [list \x9b {8[} ] $c]
switch -- [string index $cnorm 1][string index $cnorm end] {
#switch -- [string index $cnorm 1][string index $cnorm end] {}
{[m} {
# {[m}
set params [string range $cnorm 2 end-1] ;#strip leading esc lb and trailing m
#has_sgr_reset - rather than support this function - create an sgr normalize function that removes dead params and brings reset to front of param list?
#has_sgr_reset - rather than support this function - create an sgr normalize function that removes dead params and brings reset to front of param list?
#define our positive responses here for those that we will do
#define our positive responses here for those that we will do
variable respond_will_do
variable respond_will_do
set respond_will_do [list]
set respond_will_do [list]
#lappend respond_will_do 0 ;#binary
lappend respond_will_do 0 ;#binary
lappend respond_will_do 1 ;#echo
lappend respond_will_do 1 ;#echo
lappend respond_will_do 3 ;#suppress go-ahead
lappend respond_will_do 3 ;#suppress go-ahead
lappend respond_will_do 5 ;#status - by agreeing to this we should be able to read unsolicited "IAC SB STATUS IS ... IAC SE" reports and compare to our perception of state. (and do something if mismatches?)
lappend respond_will_do 5 ;#status - by agreeing to this we should be able to read unsolicited "IAC SB STATUS IS ... IAC SE" reports and compare to our perception of state. (and do something if mismatches?)
#passively enabled client features - requests for our own behaviours we will respond positively
#passively enabled client features - requests for our own behaviours we will respond positively
variable respond_do_will
variable respond_do_will
set respond_do_will [list]
set respond_do_will [list]
#lappend respond_do_will 0 ;#binary
lappend respond_do_will 0 ;#binary
lappend respond_do_will 3 ;#Suppress go-ahead
lappend respond_do_will 3 ;#Suppress go-ahead
lappend respond_do_will 5 ;#status - by agreeing to this - we need to handle the subnegotiation "IAC SB STATUS SEND IAC SE" and respond with "IAC SB STATUS IS ... IAC SE"
lappend respond_do_will 5 ;#status - by agreeing to this - we need to handle the subnegotiation "IAC SB STATUS SEND IAC SE" and respond with "IAC SB STATUS IS ... IAC SE"
set opt_exposed2 [dict get $opts -exposed2] ;#widechar_exposed_right - todo
set opt_exposed2 [dict get $opts -exposed2] ;#widechar_exposed_right - todo
# -- --- --- --- --- ---
# -- --- --- --- --- ---
#a hack until we work out how to avoid infinite loops...
#
set looplimit [dict get $opts -looplimit]
# ----------------------------
# ----------------------------
# -experimental dev flag to set flags etc
# -experimental dev flag to set flags etc
# ----------------------------
# ----------------------------
@ -345,6 +341,9 @@ proc overtype::left {args} {
#set underlines [split $underblock \n]
#set underlines [split $underblock \n]
#underblock is a 'rendered' block - so width height make sense
#underblock is a 'rendered' block - so width height make sense
#colwidth & colheight were originally named with reference to rendering into a 'column' of output e.g a table column - before cursor row/col was implemented.
#The naming is now confusing. It should be something like renderwidth renderheight ?? review