At Wed, 20 Apr 2022 11:07:35 -0400 [email protected] wrote:
Hello,
I have noticed a strange behavior by tcl/tk shells that I would like
to avoid. This happens with tclsh, wish, and tkcon. I say shell
but it may just be the text widget behind the scenes causing this:
Whenever the shell needs to display back a slightly large amount of
text, it locks up. I am not talking about 10's of megabytes of text
either. Just a few kilobytes maybe. The larger the text, the
longer the wait. Sometimes, you just end up terminating the whole
session because the wait is so long.
Does anyone have a solution for this?
I've never noticed this (at least not on Linux).
Hello,
I have noticed a strange behavior by tcl/tk shells that I would like to avoid. This happens with tclsh, wish, and tkcon. I say shell but it
may just be the text widget behind the scenes causing this:
Whenever the shell needs to display back a slightly large amount of
text, it locks up. I am not talking about 10's of megabytes of text
either. Just a few kilobytes maybe. The larger the text, the longer
the wait. Sometimes, you just end up terminating the whole session
because the wait is so long.
Does anyone have a solution for this?
I've seen it on windows machines with the default wish console, but
not with "a few kilobytes", the text had to be quite large (i.e., significantly larger than "a few kilobytes", bordering on megabytes or
so).
Two (maybe) solutions to the OP:
1) when running commands that would return a lot of text -- but you do
not really need the text printed, append a "; list" to the end before executing the command. The text that would return will not show
(because what you'll see is the return from 'list', which is an empty
list.
2) try TkCon (https://wiki.tcl-lang.org/page/Tkcon). It might cope
better, but it might not, as it uses the text widget behind the scenes
as well.
I've never noticed this (at least not on Linux).
Is there anything special about the text? Hugely long lines? Strange character sets? How are you inserting this text?
Hello,
I have noticed a strange behavior by tcl/tk shells that I would like to avoid. This happens with tclsh, wish, and tkcon. I say shell but it
may just be the text widget behind the scenes causing this:
Whenever the shell needs to display back a slightly large amount of
text, it locks up. I am not talking about 10's of megabytes of text either. Just a few kilobytes maybe.
On 4/20/22 12:13 PM, Rich wrote:
I've seen it on windows machines with the default wish console, but
not with "a few kilobytes", the text had to be quite large (i.e.,
significantly larger than "a few kilobytes", bordering on megabytes or
so).
Hello,
Yes, this is on a Windows machine too. I checked the actual size of the
data and you are right: it is over 100-200 Kbyte raange. The data is in
an array and while the array itself is small in terms of entries, some
of its data consists of coordinates of canvas line segments, which to my surprise were quite long.
Two (maybe) solutions to the OP:
1) when running commands that would return a lot of text -- but you do
not really need the text printed, append a "; list" to the end before
executing the command. The text that would return will not show
(because what you'll see is the return from 'list', which is an empty
list.
This is a good trick. I use "; set x" where x does not exist. But list
is a nicer solution.
2) try TkCon (https://wiki.tcl-lang.org/page/Tkcon). It might cope
better, but it might not, as it uses the text widget behind the scenes
as well.
I see it with wish and tkcon, but not tclsh. I suspect it has to do with coloring for some reason.
With tclsh, the 'console' it uses is the windows cmd shell window (or
power shell window) that it runs within, so it does not need to
"provide a console". It just pushes data out the stdout file channel
and is done. The cmd shell or power shell window handles the display
of that data.
This is a known issue with the current text widget, it scales very badly
with the length of the lines. When you have a lot of text and the line
length is limited, like e.g.
On 4/20/22 2:27 PM, Christian Gollwitzer wrote:
This is a known issue with the current text widget, it scales very
badly with the length of the lines. When you have a lot of text and
the line length is limited, like e.g.
Hello,
Thank you! I suppose as long as it is fixed and is scheduled for
release, that is OK.
The problem it addresses is the code normally does a
.console see insert
for every line output through the :tk::ConsoleOutput code. This hack
will cause it to do that at most 5 times a second.
On 4/20/22 8:14 PM, jtyler wrote:
The problem it addresses is the code normally does a
.console see insert
for every line output through the :tk::ConsoleOutput code. This hack
will cause it to do that at most 5 times a second.
Hello,
Interesting - it works from the wish console. The same amount of output that locks up normal wish console is now instantaneous. However, there seems to be a side effect: it seems to slow down everything. Opening my application window, I can see widgets appearing one by one (i.e., very slowly). Even dragging the console window by its title bar (from MS Windows) is slow and jumpy. Ideally it could have a way to turn it on
and off depending on the amount of text.
In any case, as annoying as it could be at times, the original issue is
no big deal really.
| Sysop: | Keyop |
|---|---|
| Location: | Huddersfield, West Yorkshire, UK |
| Users: | 715 |
| Nodes: | 16 (3 / 13) |
| Uptime: | 156:32:43 |
| Calls: | 12,093 |
| Calls today: | 1 |
| Files: | 15,000 |
| Messages: | 6,517,738 |