From 7409f3a605980530abcbcbe1c8fa8443bb341075 Mon Sep 17 00:00:00 2001 From: Julian Noble Date: Thu, 26 Sep 2024 03:25:33 +1000 Subject: [PATCH] console work --- src/bootsupport/modules/punk/console-0.1.1.tm | 8 ++++++-- src/modules/punk/repl-0.1.tm | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/bootsupport/modules/punk/console-0.1.1.tm b/src/bootsupport/modules/punk/console-0.1.1.tm index 6f385194..95ecb27d 100644 --- a/src/bootsupport/modules/punk/console-0.1.1.tm +++ b/src/bootsupport/modules/punk/console-0.1.1.tm @@ -177,9 +177,13 @@ namespace eval punk::console { } - #todo - something better - the 'channel' concept may not really apply on unix, as raw mode is for input and output modes + #todo - something better - the 'channel' concept may not really apply on unix, as raw mode is set for input and output modes currently - only valid to set on a readable channel? + #on windows they can be set independently (but not with stty) - REVIEW + + #NOTE - the is_raw is only being set in current interp - but the channel is shared. + #this is problematic with the repl thread being separate. - must be a tsv? REVIEW proc enableRaw {{channel stdin}} { - variable is_raw + variable is_raw variable previous_stty_state_$channel set sttycmd [auto_execok stty] if {[set previous_stty_state_$channel] eq ""} { diff --git a/src/modules/punk/repl-0.1.tm b/src/modules/punk/repl-0.1.tm index 48f10610..528a7e22 100644 --- a/src/modules/punk/repl-0.1.tm +++ b/src/modules/punk/repl-0.1.tm @@ -1368,7 +1368,7 @@ proc repl::repl_handler {inputchan prompt_config} { #but can be *slow* compared to unix e.g 400ms+ vs <2ms on FreeBSD ! set tputcmd [auto_execok tput] if {$tputcmd ne ""} { - if {![catch {exec {*}$tputcmd cols lines} values} { + if {![catch {exec {*}$tputcmd cols lines} values]} { lassign $values cols rows } }