WINCH-SETS-⎕PW did not originally work, on macOS Sonoma 14.7.2. Because macOS does not use the same TIOCGWINSZ magic number that was hard-coded. With the first patch, WINCH-SETS-⎕PW does now work on macOS.
>From my original email: > I noticed that quad-pw wasn't changing with window resizes on macOS (Sonoma 14.7.2). > Here's a patch; there's probably a better way to do it. On Mon, Dec 23, 2024 at 6:12 AM Dr. Jürgen Sauermann < mail@jürgen-sauermann.de> wrote: > Hi, > > I am still not clear about whether the WINCH-SETS-⎕PW preference > works or does not work on Mike's platform (which ?). Could someone > please test that? > > Thanks, > Jürgen > > > On 12/22/24 20:03, M.Hall wrote: > > Paul Rockwell writes: > > > There may be a side effect, though. With the option set and Mike's code > inserted, ⎕PW will be set to whatever the current terminal width is, not > the IBM APL2 default of 80. > > Yes. There are three settings that interact: > - command line "--PW xx" > - preferences "INITIAL-⎕PW xx" > - preferences "WINCH-SETS-⎕PW" > > The command line setting overrides all others. This makes sense to me. > > INITIAL-⎕PW is active when WINCH-SETS-⎕PW is off. Also, good. > > When WINCH-SETS-⎕PW is enabled, the code bypasses the INITIAL-⎕PW setup. > Hmmm. > > I think the user's INITIAL-⎕PW should be used at startup, even when > WINCH-SETS-⎕PW is enabled. > > So the startup priority would be (high to low): > - command line > - INITIAL-⎕PW > - then WINCH > - then default 80 columns > > Here's a patch for that, if you want (applied against the previous patch): > > $ diff -u src/main-orig.cc src/main.cc > --- src/main-orig.cc 2024-12-19 13:20:04.000000000 -0600 > +++ src/main.cc 2024-12-22 10:11:42.000000000 -0600 > @@ -449,10 +452,8 @@ > sigaction(SIGWINCH, &new_WINCH_action, &old_WINCH_action); > signal_WINCH_handler(0); // pretend window size change > } > - else > - { > - Workspace::set_PW(UserPreferences::uprefs.initial_pw, LOC); > - } > + // honor the user's initial PW preference, even if WINCH is enabled > + Workspace::set_PW(UserPreferences::uprefs.initial_pw, LOC); > > #if PARALLEL_ENABLED > memset(&new_control_BSL_action, 0, sizeof(struct sigaction)); > > > -- > Mike Hall > > > > -- Mike Hall