ZTree.com  | ZEN  | About...  

 Index   Back

Bug and ZEP: Resizing window via dragging frame edge - more comments   [Zeta]

By: Ben Kent       
Date: Jan 04,2023 at 20:15
In Response to: [Zeta] v2.4.206 Now Available! (Kim Henkel)

Investigations into this new feature
*Added - Experimental support for resizing window via dragging frame edge


o. Overview

[Bug] F9 application menu: If Rows>199, and F9 items>199, and F9 remembered application menu item is on the last line, then crash on opening the menu.
Why is that when the ZAM file has 16bit fields for offset and highlighted?

resize by frame
[Bug] ZTree crash if number of rows is over 211
[Comment] ZTree crashes are more likely on resize by frame using the corner, far fewer crashes when resizing using the sides
[Discuss] Odd number of columns is allowed
[Bug] Right hand pane/stats panel border issues.
[ZEP] Vertical scrollbar causes reduction in width by three columns when reducing the size
[ZEP] Fractional right-hand character with debris
[ZEP] It would be good if a screen draw automatically happened after releasing the mouse when resizing by frame

Screen draw issues
[Bug] on large consoles (I think wider than 512 characters), a copy of the left hand pane offset in the right pane, missing horizontal SFW dividers, ...
Split screen
[Bug] Exiting from eXecute, Exiting from Extended Statistics Window, F8, tab between panes, into and out of SFW
[ZEP] Alt-F7 will not make the ZTree part of the console wider than 512

Running under Terminal issues (many)
Alt-F8 and Alt-F9 just give the bell
Alt-F7 and F8 screen draw issues
Resizing the window can cause issues later
Many more crashes than when doing the same actions under console
If ZTree is launched from Powershell Start-Process, the eXecute output is lost

Many of the crashes are in conhost.exe which causes ZTree to disappear and consume all of a CPU, some previous posts
[Bug] Crash after exiting from Alt-F5 https://www.ztw3.com/forum/forum_entry.php?id=123757
[Bug] ZTree hangs to hidden task with heavy load https://www.ztw3.com/forum/forum_entry.php?id=123345
Whereas some crashes are in ZTree, so you don't get a zombie process


Alt-Filedisplay, needs thinking about with wide consoles
[ZEP] Possibly use Shift-Up/Down to control the number of file columns in the file window, to allow the user to tune the display to their requirements.
Show more information if there is space: increase the Attributes to the full list from Alt-Info, the size to allow for 256TB without using multipliers and show milliseconds on the time assuming it's logged.



=================================================================================================


Comment:
A number of the crashes are in conhost.exe, which causes ZTree to turn into a zombie process consuming all of a CPU core in the background, which is a waste of power.


o. On large console (or small fonts) and returning from "Extended Statistics Window"
Setup: Alt-Space, Properties, Font tab, Size=5, OK, border drag the console window to the biggest you can make it
For me: Cols 956 Rows 201 List height 195
ZTree: Split enabled, Sh-F8=Current, ?, Esc
Issue 1: Top and bottom lines of the SFW are not drawn on both panes, tabbing between the two panes fixes the top line of SFW
Issue 2: On the right hand side, offset ~46 chars to the right, and one char up is a duplicate of the left hand pane, tabbing between panes fixes it.
Issue 3: Get similar screen draw issues on returning from eXecute, different issues depending on which pane was active

o. On large console (or small fonts) and the Application menu
Setup: same as above
Issue: If Rows>199, and F9 items>199, and F9 remembered application menu item is on the last line, then crash on opening the menu.
Note: From what I can tell of the *.ZAM file format the offset and highlight values are 16bit little endian, so I don't understand the reason for the "Application menu, the highlighted item on the page" limit of 190, but I don't have access to the code.
This is the .ZAM file header
"\x02 ZTreeMenu (tm)\x1A\x00{0}{1}\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02", nOffset, nHighlighted

o. On large console (or small fonts) Alt-F7 width issue
Setup: Alt-Space, Properties, Font tab, Size=5, OK
ZTree: Split enabled, Sh-F8=Current, Alt-F7
Issue: The ZTree window sizes to full screen, but the ZTree is limited to 512 columns, i.e. there is corrupted/empty space to the right of the active space, which is different to the "resizing by frame" behaviour.
Why do Alt-F7 and "resizing by frame" act differently?

o. After a previous crash
Setup: Cause one of these resize crashes, then sometimes on a later start of ZTree, possibly the second after the crash
Issue: get this at start-up
-------
Error: Unrecognized command history item read from [C:\Users\********\AppData\Roaming\ZTreeWin\ZTW.HST]!
[]
Press [Enter] to continue...
-------
Looking at ZTW.HST there is this "\r\nPP\x00\r\n", which is probably the cause
Note: I had a few of those in one testing session, but not since then.


o. Running under Terminal issues
General:
Issue: Under terminal Alt-F8 and Alt-F9 just give the bell, are they supported?
Issue: It's looking like Alt-F7 can mess up the terminal session, which leads to ZTree screen draw issues, and could possibly cause some of the conhost.exe crashes, and cause issues when returning to powershell in Terminal. So it's best to test in a fresh terminal window, to separate effects and side effects.
Issue: when using the Powershell Start-Process mode, the eXecute output is lost


Details:

Mode: Powershell Start-Process
Setup: Terminal, Start-Process -FilePath "C:\Program Files\ZTree Windows\ZTW64.EXE" -ArgumentList "/M /Y /ZB /ZM /ZV$env:AppData\ZTreeWin\$env:COMPUTERNAME.ZLOG"
Behaviour: ZTree starts in a new console, with "Cols 269 Rows 71 List height 65, Files/page 18 Name.ext length 79.4"
Setup: highlight a directory, eXecute, icacls %1
Issue: the output of the command is overwritten when the command returns and "Tab Current file F3 Last ? History ?-+ OK ESC Cancel" bottom bar is displayed again. That can be worked round by using eXecute, icacls %1 & pause
Issue: Alt-F8 and Alt-F9 just give the bell
Issue: I saw a couple of cases where ZTree switched to 80x25 when returning from the command, although I cannot reproduce.
Issue: The first Alt-F7 can sometimes maximize the terminal window, which means that Alt-F7 after that leaves the terminal window maximized, and changes the ZTree area inside that window.
Setup: Alt-Space, restore
Behaviour: Now Alt-F7 works as expected.
Issue: "resize by frame" causes a conhost.exe crash

Mode: Powershell Run
Setup: Terminal, & "C:\Program Files\ZTree Windows\ZTW64.EXE" /M /Y /ZB /ZM /ZV$env:AppData\ZTreeWin\$env:COMPUTERNAME.ZLOG
Behaviour: ZTree starts in the current Terminal tab, there is a black border
Behaviour: eXecute output displayed as expected
Issue: Alt-F8 and Alt-F9 just give the bell
Issue: Alt-F7 gives a 80x25 ZTree in a bigger terminal, with a number of screen draw issues
Behaviour: "resize by frame" works

Mode: Cmd run
Setup: Terminal, cmd, "C:\Program Files\ZTree Windows\ZTW64.EXE" /M /Y /ZB /ZM /ZV%AppData%\ZTreeWin\%COMPUTERNAME%.ZLOG
Behaviour: ZTree starts in the current Terminal tab, there is a black border
Behaviour: eXecute output displayed as expected
Issue: Alt-F8 and Alt-F9 just give the bell
Issue: Alt-F7 and F8 many screen draw issues
Issue: second Alt-F7, ZTree switches to 80x25 in 187x48 console, many screen draw issues
Behaviour: "resize by frame" works

Mode: Cmd start
Setup: Terminal, cmd, start "" "C:\Program Files\ZTree Windows\ZTW64.EXE" /M /Y /ZB /ZM /ZV%AppData%\ZTreeWin\%COMPUTERNAME%.ZLOG
Issue: get this popup,
---------------------------
Error
---------------------------
Could not get window handle
---------------------------
OK
---------------------------
Behaviour: then ZTree starts in the new console
So I try adding /NC to the commandline, still get the popup
Behaviour: eXecute output displayed as expected
Issue: Alt-F8 and Alt-F9 just give the bell
Issue: Alt-F7 causes a conhost.exe crash
Issue: "resize by frame" causes a conhost.exe crash if resizing using the bottom right corner and making the window smaller


Comment:
When running under Terminal it's easy to get the terminal session into an inconsistent state, which can lead to later problems
Where the cause is (Terminal, ZTree or both) I don't know.
So currently it's probably best to advise against the use of Terminal particularly if ZTree console sizing (either method) is going to be used.


o. Running under Console issues
Repeating the tests using console instead of Terminal

These tests
eXecute output icacls %1, ?, F8, Alt-F7, Alt-F8, Alt-F9, resize by frame (width, height, both)

for these modes
Mode: Powershell Start-Process
Mode: Powershell Run
Mode: Cmd run
Mode: Cmd start

All OK apart from
"resize by frame", using the bottom right corner, and making the console smaller, which causes a conhost.exe crash, and the ztw64.exe process consuming all of a core.

So, it would be good if resize by corner when running under console could be fixed, as that is the cause of most of the running under console crashes.

But as reported a number of times people have reported conhost/ZTree crashes in the past, the most common for me is returning from Alt-F5,view

TODO: Retest for odd and even columns
Alt-F5,view,esc,esc
Alt-F10,esc


o. Number of rows issues
Keeping with console, as it seems ZTree and Terminal don't play nicely, and investigating how far I can push the number of rows.
Setup:
Set a screen to portrait
Move ZTree to that screen
Alt-Space, Properties, Font tab, Size=5, OK
Use resize by frame, right: get to 534 columns
Use resize by frame, bottom: get to 211 rows
Issue: Beyond 211 rows, ZTree crashes with this in the eventlog
Exception code: 0xc0000005
Fault offset: 0x0000000000059a7f
i.e. I cannot get beyond
DISPLAY INFORMATION
Cols 534 Rows 211 List height 205
Files/page 57 Name.ext length 211.4
Screen resolution 1080 x 1920

To rule out buffer space issues, I reduce to 80 columns and recheck number of rows, ZTree still crashes beyond 211 rows.

Comment:
Making the ZTree window wider and wider, reduces value, unless there are many long directory names, otherwise most of the screen will be empty space.
For the single column Alt-Filedisplay modes the max usable columns is in the 634-694 range, see below.
The number of rows will have value at any value, because there can be lots of files and directories



=================================================================================================
o. Number of columns issues
Odd number of columns is allowed
Which could be useful with F8 split and Sh-F8=current
With No split, or Split and Sh-F8!=Current, then the spare character needs to go somewhere
Issue: Split, with Sh-F8=current, causes stats panel/DW-FW border issues, different issues for odd and even number of columns
Issue: Split, with Sh-F8=both, and odd number of columns, causes stats panel/DW-FW border issues, wouldn't be a problem if the number of columns was forced to be even
Comment: before "resize by frame" was added, ZTree has always enforced an even number of columns. Which made some things simpler, but going forward I have no objection to odd number of columns being supported, as long as there are no screen draw issues.

Issue: Right hand fractional character can have the highlight colour and other debris
It would be nice if the console could be reduced to a whole number of characters, then there would be no issue.

Issue: When making the console narrower using "resize by frame" (which causes wrapping and a scrollbar) then the number of columns reduces by three, i.e. the scrollbar is not included in the calculation. Can that be handled? to stop the width reducing unnecessarily


To see how far I could push it, I changed to a 5 point font (unreadable) and got this, on a 4K screen I would expect roughly twice the number rows and columns
====
DISPLAY INFORMATION
Cols 944 Rows 202 List height 196
Files/page 53 Name.ext length 407.3
Screen resolution 1920 x 1080
====

As GetVolumeInformation() lpMaximumComponentLength is 255 on NTFS (the max file/directory name is 255 chars) and the filename length limit on Linux file systems I could find is 255 bytes. There is no point ZTree having "Name.ext length" wider than that limit.

Checking the ZTree Alt-Filedisplay behaviour on my machine at min and max width at the standard font size.
Name.ext length
columns
80 80s 238 238s
name.ext 1 56 1 37 1 214 1 56
name/ext 3 12.4 2 12.4 8 14.4 4 14.4
n/e/s/a 2 8.3 1 14.4 6 11.4 3 10.4
n/e/s/a/d 1 14.4 1 8.3 1 172.4 1 63.4


ZEP
When there is space, increase the Attributes to the full list from Alt-Info, the size to allow for 256TB without using multipliers and show milliseconds on the time assuming it's logged.

ZEP
The current Alt-Filedisplay behaviour seems to prioritize columns over information, so depending on the job at hand the user might want fewer columns with each showing more information.
File window Shift-Up/Down could be used to change the number of columns in the file window, so the user can get the level of detail that they want. That command will affect all of the Alt-Filedisplay modes.

Comment:
As most file extensions are less than 12 characters, that could be an underlying constant or config option to guide behaviour.


Thanks
Ben

71 views      
 

Messages in this Thread

 
96,194 Postings in 12,153 Threads, 350 registered users, 37 users online (2 registered, 35 guests)
Index | Admin contact |   Forum Time: Jan 27, 2023 - 12:42 am UTC  |  Hits:53,203,368  (601 Today )
RSS Feed