diff --git a/doc/CHANGELOG.md b/doc/CHANGELOG.md index c6ccb96b..19d02f1d 100644 --- a/doc/CHANGELOG.md +++ b/doc/CHANGELOG.md @@ -77,6 +77,7 @@ The full set of tests is only run for tagged releases. - move `using namespace std` after includes (clang warning) - some selected clang -Weverything aspects - now -Wdocumentation clean (some wrong doxygen trailing comments) +- rw11/shell.tcl: add workaround for tclreadline and `after` interference ### Bug Fixes - RtclArgs.hpp: BUGFIX: get *_min limits correct (gcc -Wpedantic) diff --git a/tools/tcl/rw11/shell.tcl b/tools/tcl/rw11/shell.tcl index 9fcdc003..cac77763 100644 --- a/tools/tcl/rw11/shell.tcl +++ b/tools/tcl/rw11/shell.tcl @@ -1,6 +1,6 @@ -# $Id: shell.tcl 985 2018-01-03 08:59:40Z mueller $ +# $Id: shell.tcl 1058 2018-10-21 21:46:26Z mueller $ # -# Copyright 2015-2017 by Walter F.J. Mueller +# Copyright 2015-2018 by Walter F.J. Mueller # # This program is free software; you may redistribute and/or modify it under # the terms of the GNU General Public License as published by the Free @@ -13,6 +13,7 @@ # # Revision History: # Date Rev Version Comment +# 2018-10-21 1058 2.2.5 add after#\d+ scrubber (a real HACK, sorry) # 2017-04-23 885 2.2.4 adopt .cm* to new interface # 2017-04-22 883 2.2.3 integrate rbmon: add .rme,.rmd,.rmf,.rml # 2017-04-16 879 2.2.2 rename .cres->.crst and .cr->.cres (more intuitive) @@ -108,6 +109,19 @@ namespace eval rw11 { # shell_forward: rw11 shell forwarder (will be renamed to ::unknown) ------- # proc shell_forward args { + # in tcl 8.6 tclreadline and after interferes in some strange manner + # commands are sometime prefixed with 'after#nnn'. This BLOODY HACK + # looks for commands starting with 'after#\d+', scrubs of prefix, and + # executes them via uplevel. + set cmd [lindex $args 0] + set cmdo $cmd + regsub -all {^after#\d+} $cmd {} cmd + if {$cmd ne $cmdo} { + if {$cmd eq ""} { return "" } + lset args 0 $cmd + uplevel 1 [list {*}$args] + return "" + } uplevel 1 [list rw11::shell {*}$args] }