Corruption in TCMD tab window

May 20, 2008
11,520
102
Syracuse, NY, USA
The last command in TCC's history is

Code:
v:\> PDir z:\Windows\winsxs\* /A-D /S /(-128.182fn zc dy/m/d th:m:s fp) | d:\Gnu\sort.exe

Recalled in a console window, it's wrapped right after the 'u' in "gnu". If I start TCMD (13/TCC 13) and press [Up] the command appears wrapped, as above, even though there are 10 (or so) spaces left on the first line. [Esc] doesn't erase the wrapped part.

That does not happen in an identically-sized TCMD12.
 
May 20, 2008
11,520
102
Syracuse, NY, USA
The last command in TCC's history is

Code:
v:\> PDir z:\Windows\winsxs\* /A-D /S /(-128.182fn zc dy/m/d th:m:s fp) | d:\Gnu\sort.exe
Recalled in a console window, it's wrapped right after the 'u' in "gnu". If I start TCMD (13/TCC 13) and press [Up] the command appears wrapped, as above, even though there are 10 (or so) spaces left on the first line. [Esc] doesn't erase the wrapped part.

That does not happen in an identically-sized TCMD12.

This seems to be edgy in that it only happens when the most recent command in TCC's history wraps (any command will do) and the first thing you do after starting TCMD is Up-arrow. It doesn't happen on subsequent recalls, not even if you don't execute it (Up-arrow ... Esc ... Enter ... Up-arrow).
 
May 20, 2008
11,520
102
Syracuse, NY, USA
This seems to be edgy in that it only happens when the most recent command in TCC's history wraps (any command will do) and the first thing you do after starting TCMD is Up-arrow. It doesn't happen on subsequent recalls, not even if you don't execute it (Up-arrow ... Esc ... Enter ... Up-arrow).

I still didn't get it exactly. The command doesn't have to be at the end of the history. The corruption is observed as long as you up-arrow to a console-wrapped command before [Enter] is pressed in any new tab.
 
May 20, 2008
603
0
Sammamish, WA
I can reliably reproduce the (or a similar) issue with this sequence:

.) Start tcmd with brand new, no history tcc tab
.) Size the tcmd window so a long command will not wrap
.) Get a long command into the history (Normally or with ^k)
.) Size the tcmd box so the command will wrap
.) Press up-arrow. The command does not wrap to the next line. The end of
the line gets overwritten.
.) Press esc
.) Press up-arrow. The command does wrap properly.
.) Press esc
.) Size the tcmd window so the command will not wrap
.) Press up-arrow. The command wraps, in spite of room

However, the problem goes away after the esc, and it does the same thing in
12, for me.


On Sun, Oct 2, 2011 at 21:37, vefatica <> wrote:


> ---Quote (Originally by vefatica)---
> This seems to be edgy in that it only happens when the most recent command
> in TCC's history wraps (any command will do) and the first thing you do
> after starting TCMD is Up-arrow. It doesn't happen on subsequent recalls,
> not even if you don't execute it (Up-arrow ... Esc ... Enter ... Up-arrow).
> ---End Quote---
> I still didn't get it exactly. The command doesn't have to be at the end
> of the history. The corruption is observed as long as you up-arrow to a
> console-wrapped command before [Enter] is pressed in any new tab.
>
>
>
>
>



--
Jim Cook
2011 Monday: 4/4, 6/6, 8/8, 10/10, 12/12 and 5/9, 9/5, 7/11, 11/7.
Next year they're Tuesday.
 

rconn

Administrator
Staff member
May 14, 2008
12,404
152
I can reliably reproduce the (or a similar) issue with this sequence:

.) Start tcmd with brand new, no history tcc tab
.) Size the tcmd window so a long command will not wrap
.) Get a long command into the history (Normally or with ^k)
.) Size the tcmd box so the command will wrap
.) Press up-arrow. The command does not wrap to the next line. The end of
the line gets overwritten.
.) Press esc
.) Press up-arrow. The command does wrap properly.
.) Press esc
.) Size the tcmd window so the command will not wrap
.) Press up-arrow. The command wraps, in spite of room

However, the problem goes away after the esc, and it does the same thing in 12, for me.

WAD -- this is old, old, old behavior going back 20+ years. It's been brought up several times since then, and after explanations the users have always decided to keep it the way it is.

TCC checks its screen size before each character is entered. The problem in your example is that TCC is waiting for a Windows API to return a keystroke when you change the window size. So TCC doesn't recognize the new size until after it's processed the current keystroke.

Earlier trials that checked the window size, checked for a keystroke without waiting and looped back to check the window sized again always foundered due to either excessive overhead or slow response time to keyboard input. I might revisit this now that most people are running (much) faster systems. But IMHO it doesn't merit being put at the top of the new feature list.
 
May 20, 2008
603
0
Sammamish, WA
I thought the behavior was acceptable, actually. I've been annoyed by it, but since ESC, Enter has always cleared the state, I always felt this was more in the lines of "I've done something silly, and a silly result happened" and it didn't seem worth complaining about.Vince's problem may be different.-- Sent from my HP TouchPadOn Oct 3, 2011 8:36, rconn <> wrote: ---Quote (Originally by Jim Cook)---
I can reliably reproduce the (or a similar) issue with this sequence:

.) Start tcmd with brand new, no history tcc tab
.) Size the tcmd window so a long command will not wrap
.) Get a long command into the history (Normally or with ^k)
.) Size the tcmd box so the command will wrap
.) Press up-arrow. The command does not wrap to the next line. The end of
the line gets overwritten.
.) Press esc
.) Press up-arrow. The command does wrap properly.
.) Press esc
.) Size the tcmd window so the command will not wrap
.) Press up-arrow. The command wraps, in spite of room

However, the problem goes away after the esc, and it does the same thing in 12, for me.
---End Quote---

WAD -- this is old, old, old behavior going back 20+ years. It's been brought up several times since then, and after explanations the users have always decided to keep it the way it is.

TCC gets its screen size when it enters the line input routine, and again after each character is entered. The problem in your example is that TCC is waiting for a Windows API to return a keystroke when you change the window size. So TCC doesn't recognize the new size until after it's processed the current keystroke.

Earlier trials that checked the window size, checked for a keystroke without waiting and looped back to check the window sized again always foundered due to either excessive overhead or slow response time to keyboard input. I might revisit this now that most people are running (much) faster systems. But IMHO it doesn't merit being put at the top of the new feature list.
 

rconn

Administrator
Staff member
May 14, 2008
12,404
152
Recalled in a console window, it's wrapped right after the 'u' in "gnu". If I start TCMD (13/TCC 13) and press [Up] the command appears wrapped, as above, even though there are 10 (or so) spaces left on the first line. [Esc] doesn't erase the wrapped part.

That does not happen in an identically-sized TCMD12.

Not reproducible here, nor can I conceive of any way that could possibly happen. (There is no wrap information contained in the history lists.)

Unless you've neglected to mention a critical factor, such as you've configured TCMD 13 to auto-attach existing consoles, and you're pressing [Up] in the same console that you were running stand-alone previously. In which case the wrap would be expected (see my previous explanation to Jim). Or that you have a plugin that's doing its own resizing.
 
May 20, 2008
11,520
102
Syracuse, NY, USA
On Mon, 03 Oct 2011 11:58:04 -0400, rconn <> wrote:

|---Quote (Originally by vefatica)---
|Recalled in a console window, it's wrapped right after the 'u' in "gnu". If I start TCMD (13/TCC 13) and press [Up] the command appears wrapped, as above, even though there are 10 (or so) spaces left on the first line. [Esc] doesn't erase the wrapped part.
|
|That does not happen in an identically-sized TCMD12.
|---End Quote---
|
|Not reproducible here, nor can I conceive of any way that could possibly happen. (There is no wrap information contained in the history lists.)
|
|Unless you've neglected to mention a critical factor, such as you've configured TCMD 13 to auto-attach existing consoles, and you're pressing [Up] in the same console that you were running stand-alone previously. In which case the wrap would be expected (see my previous explanation to Jim). Or that you have a plugin that's doing its own resizing.

I am not attaching consoles. Simply, start TCC ... issue "ECHO [enough
characters to make it wrap]" ... close TCC ... start TCMD ... press [Up-arrow].
The recalled line is wrapped at the same character as in the console even though
TCMD has more space available at the end of the first line. And [Esc] doesn't
clear the entire recalled command

Everything's fine in a tab after [Return] has been pressed once. But open
another tab and you see the problem again.

To put it another way, TCMD doesn't resize the console to match its tab window
width until [Enter] has been pressed. This is evidenced by the following: If I
make TCMD's COMSPEC "d:\tc13\tcc.exe echo %_ruler", when a tab opens I see an
80-character ruler, though the tab window can handle 91 characters. If I then
issue "ECHO %_RULER" I get a 91-character ruler.

Note _RULER is my plugin (4UTILS); it merely prints a ruler as wide as the
console screen buffer (and knows nothing about TCMD).
 

rconn

Administrator
Staff member
May 14, 2008
12,404
152
To put it another way, TCMD doesn't resize the console to match its tab window width until [Enter] has been pressed.

Definitely *not* true (and not reproducible). The console is created and resized when TCMD creates the tab window. There is no resizing at all going on in Take Command or in TCC when in the TCC line input routine.

There's something else happening in your configuration that you haven't revealed yet.
 

rconn

Administrator
Staff member
May 14, 2008
12,404
152
This is evidenced by the following: If I
make TCMD's COMSPEC "d:\tc13\tcc.exe echo %_ruler", when a tab opens I see an 80-character ruler, though the tab window can handle 91 characters. If I then issue "ECHO %_RULER" I get a 91-character ruler.

That's not a valid test. It's showing the state of the console window when it was initially created, not the current state.

When TCMD starts the TCC session, it cannot create the console in the size that TCMD wants. (There is no way to do that in Windows.) Instead, it starts TCC (hidden), and the Windows console manager creates the default window size. TCMD waits until it can access the console window, which (another Windows limitation) isn't for 20-30 milliseconds after TCC loads and begins execution. In that time, TCC can easily have executed TCSTART and be on to doing other things.


Note _RULER is my plugin (4UTILS); it merely prints a ruler as wide as the
console screen buffer (and knows nothing about TCMD).[/QUOTE]
 
May 20, 2008
11,520
102
Syracuse, NY, USA
On Mon, 03 Oct 2011 17:05:03 -0400, rconn <> wrote:

|Definitely *not* true (and not reproducible). The console is created and resized when TCMD creates the tab window. There is no resizing at all going on in Take Command or in TCC when in the TCC line input routine.
|
|There's something else happening in your configuration that you haven't revealed yet.

Well I'd like to hear from others. It's so simple. If there's a command
anywhere in TCC's history that would wrap if recalled in a console, and TCMD
shows more columns that a normally-started console, then start a TCMD and,
WITHOUT PRESSING ANY OTHER KEY, arrow-up until that command is displayed. Its
wrapping will be corrupt as I mentioned.

See it here: ftp://lucky.syr.edu/wrap.png ... the same command recalled in a
console and (first thing) in a (new) TCMD tab ... looks best in MSPAINT. That
particular TCMD had "/q /ii /is /ip" in its COMSPEC and that particular command
was 6 commands back in the history.
 
May 20, 2008
11,520
102
Syracuse, NY, USA
On Mon, 03 Oct 2011 17:35:07 -0400, vefatica <> wrote:

|Well I'd like to hear from others. It's so simple. If there's a command
|anywhere in TCC's history that would wrap if recalled in a console, and TCMD
|shows more columns that a normally-started console, then start a TCMD and,
|WITHOUT PRESSING ANY OTHER KEY, arrow-up until that command is displayed. Its
|wrapping will be corrupt as I mentioned.

It's as if the [up-arrow] isn't triggering something that (nearly?) any other
keystroke triggers.
 
May 20, 2008
11,520
102
Syracuse, NY, USA
It's a bit elusive. I just tried it 30 times in a row (start TCMD, up-arrow, close TCMD) on both my home computer (Win7) and my work computer (XP, via remote desktop) ... with no intervening ANYTHING ... just 2-click a shortcut, up-arrow, Alt-F4, 30 times in a row. In both experiments, the corrupt display happened 23 out of 30 times (with the correct result the other 7 times).

On Mon, 03 Oct 2011 17:05:03 -0400, rconn <> wrote:

|Definitely *not* true (and not reproducible). The console is created and resized when TCMD creates the tab window. There is no resizing at all going on in Take Command or in TCC when in the TCC line input routine.
|
|There's something else happening in your configuration that you haven't revealed yet.

Well I'd like to hear from others. It's so simple. If there's a command
anywhere in TCC's history that would wrap if recalled in a console, and TCMD
shows more columns that a normally-started console, then start a TCMD and,
WITHOUT PRESSING ANY OTHER KEY, arrow-up until that command is displayed. Its
wrapping will be corrupt as I mentioned.

See it here: ftp://lucky.syr.edu/wrap.png ... the same command recalled in a
console and (first thing) in a (new) TCMD tab ... looks best in MSPAINT. That
particular TCMD had "/q /ii /is /ip" in its COMSPEC and that particular command
was 6 commands back in the history.
 
May 20, 2008
11,520
102
Syracuse, NY, USA
On Mon, 03 Oct 2011 21:23:48 -0400, vefatica <> wrote:

|It's a bit elusive. I just tried it 30 times in a row (start TCMD, up-arrow, close TCMD) on both my home computer (Win7) and my work computer (XP, via remote desktop) ... with no intervening ANYTHING ... just 2-click a shortcut, up-arrow, Alt-F4, 30 times in a row. In both experiments, the corrupt display happened 23 out of 30 times (with the correct result the other 7 times).

In another experiment, I repeated the above (at home) with a slightly different
sequence of events. With the long command last in TCC's history ...

start TDMC, up-arrow, Alt-T-T (new tab), up-arrow, Alt-F4

I got the corrupted wrapping 20 times out of 30 in the start-up tab and EVERY
time in the second, newly-created, tab.

I'm still using "/q /ii /ip /is" in TCMD's COMSPEC.
 
May 20, 2008
11,520
102
Syracuse, NY, USA
Here's another screen shot. It shows what happens if I type (in this case "12345") after up-arrowing to a wrapped command and getting corrupt output in TCMD.

ftp://lucky.syr.edu/wrap2.png

The "1" appears immediately after the end of the command, where you'd expect it. The "2345" appear on the previous line. Aparently the "1" keystroke caused the resizing of the console. If the command (with the additional "12345") is executed and recalled, the "12345" appears at the end.
 
May 20, 2008
11,520
102
Syracuse, NY, USA
Note that you can no longer see the tail of the original corrupt recalled
command (and the "1" I typed). They were overwritten by the command's output.

On Tue, 04 Oct 2011 11:44:35 -0400, vefatica <> wrote:

|Here's another screen shot. It shows what happens if I type (in this case "12345") after up-arrowing to a wrapped command and getting corrupt output in TCMD.
|
|ftp://lucky.syr.edu/wrap2.png
|
|The "1" appears immediately after the end of the command, where you'd expect it. The "2345" appear on the previous line. Aparently the "1" keystroke caused the resizing of the console. If the command (with the additional "12345") is executed and recalled, the "12345" appears at the end.
 
May 20, 2008
3,515
4
Elkridge, MD, USA
From: vefatica
| Note that you can no longer see the tail of the original corrupt recalled
| command (and the "1" I typed). They were overwritten by the command's output.
|
| vefatica <> wrote:
|
|| Here's another screen shot. It shows what happens if I type (in this
|| case "12345") after up-arrowing to a wrapped command and getting
|| corrupt output in TCMD.
...

Vince: I cannot remember whether or not you originally mentioned the answer - does any of this happen in stand-alone TCC?
--
Steve
 
May 20, 2008
11,520
102
Syracuse, NY, USA
On Tue, 04 Oct 2011 12:31:00 -0400, Steve Fabian <> wrote:

|From: vefatica
|| Note that you can no longer see the tail of the original corrupt recalled
|| command (and the "1" I typed). They were overwritten by the command's output.
||
|| vefatica <> wrote:
||
||| Here's another screen shot. It shows what happens if I type (in this
||| case "12345") after up-arrowing to a wrapped command and getting
||| corrupt output in TCMD.
|...
|
|Vince: I cannot remember whether or not you originally mentioned the answer - does any of this happen in stand-alone TCC?

No.

And (Rex) if, after producing the corrupt recalled line, I detach the console, I
see that it is corrupt there too. This seems to indicate that the console was
resized (in this case from 80 to 91 wide) AFTER the command was recalled.
 
Similar threads
Thread starter Title Forum Replies Date
Roedy TCMD 17 corruption Support 1
G Local Directory Corruption Support 11
vefatica Corruption from FFIND? Support 5
vefatica Fixed Font corruption in IDE Support 3
J Paste corruption Support 6
vefatica Very strange console font corruption Support 3
Jay Sage TCMD Macro Recorder Support 7
MickeyF equivalent to TCSTART.btm for TCMD? Support 4
D Fixed TCMD /X option Support 7
vefatica TCMD hides itself! Support 3
vefatica Tray min'd TCMD and ACTIVATE Support 6
C How to? starting TCC/TCMD v25 Support 2
CWBillow TCC and TCMD in Powershell Support 6
kb6ojs How to? "Specified Account Already Exists" error installing TCMD v27 Support 12
CWBillow TCMD Colors Support 8
Jay Sage Issues With TCMD File Explorer Support 0
C Last TCMD that supports win 7? Support 5
gentzel TCMD background color confusion Support 6
R Upgrade TCMD 19 to TCC 26 Support 1
Alpengreis Remaining TCMD background process (v26) ... Support 19
S Windows Server version not being detected correctly in TCMD 26RC2 Support 9
G TCMD crash when copy Support 3
Joe Caverly DrawVLine results different in TCMD tab and detached TCC Support 11
Alpengreis [TCMD v25.00.24] Small space problem with the DE translation in Prefs-GUI Support 1
Alpengreis [TCMD v25.00.24] Problem with copy and paste and the # char via mouse in TCC Support 6
Jay Sage TCMD Crashes with "tctoolbar /c /r file" Support 5
nikbackm TCMD 25 - Unregister older TCMD version Support 2
G Documentation on TCMD.INI Support 9
R New Clear Buffer in TCMD Home Menu Support 2
CWBillow Back up TCMD tabs Support 2
CWBillow Upgrade Windows 10's effect on TCMD and TCC Support 3
DrusTheAxe TCMD 24.02.49 x64 crashed due to DivideByZero :-( Support 4
A After update to 24.02.49, helpfile tcmd.chm hangs when opened Support 0
David McClelland TCMD 24 & Perl - perl thinks it's own executable is ...\TCMD24\TCC.EXE??? Support 3
dcantor How to? Can 32-bit TCC be run on a system with 64-bit TCMD and TCC installed? Support 6
W pdir returns diff results between tcc and tcmd - one is an error msg Support 5
vefatica What's TCMD's problem with ^e[0m? Support 13
CWBillow TCMD PowerShell Tab elevated Support 6
A How to? Copy+Paste in TCMD tabs with Ctrl-Shift-Ins? Support 5
vefatica TCMD output invisible on Win10 Support 22
J Moving from TCC v22 to TCMD v24 issues Support 3
RChrismon How to? Copy TCMD.INI to New Version Support 7
rps TCMD OPTIONS dialog Support 2
rps TCMD Tabs priority option setting Support 0
D Can we fix the scaling for TCmd? Support 14
CWBillow TCMD Tab Defs Support 4
A How to? TCMD Configuration Dialog: 'Smooth Scrolling' Option missing? Support 1
A Fixed [23.0.22]: TCMD crashes shortly after start, TCC keeps running in background Support 6
A TCMD - Dir Command puts out blank lines? Support 16
P Symantec Endpoint Protection trapped TCMD.EXE and said it contained WS.Reputation.1 (Virus?) Support 3

Similar threads