resizing window when using "bc" in interactive mode

Franco Vaccari fvaccari at me.com
Tue Aug 13 14:08:38 UTC 2024


I’ve just contacted Gavin Howard to make him aware of the issue. He was very quick to reply, and he allowed me to share his words here on the list. So here you have them:

--------------------
Thank you for letting me know about this bug report. It is definitely an issue with my bc, either for me or Apple. It is not a MacPorts bug.

Feel free to post this reply of mine to the MacPorts list to let them know.

I semi-recently got a MBP, so I will test and fix, if necessary. However, macOS likes to pull old versions, so even if I fix it, I don't know when the fix will land in macOS proper.

Gavin Howard
---------------------

Ciao

Franco

> On 12 Aug 2024, at 15:21, Bill Cole <macportsusers-20171215 at billmail.scconsult.com> wrote:
> 
> On 2024-08-11 at 18:34:30 UTC-0400 (Sun, 11 Aug 2024 18:34:30 -0400)
> Richard L. Hamilton <rlhamil at smart.net>
> is rumored to have said:
> Semi-understandable. The default system action for SIGWINCH is to do nothing; i.e. only programs that catch it are even aware of it. That would usually be programs like text editors that do full-window text handling, and probably need to re-fetch the current size and redraw on window size change.
> Right. It is clearly a bug.
> Makes me wonder if they're using libncurses or something like it, but not using it properly.
> The Apple build uses libedit. If I build the current version source with or without --enable-editline, I cannot reproduce the bug. Looks like an Apple-specific problem.
> 
> From sigaction(2) on Monterey, the signals that do nothing by default (although in the case of SIGCHLD at least, ignoring it is a bit different from the default):
> SIGURG discard signal urgent condition present on socket
> SIGCONT discard signal continue after stop
> SIGCHLD discard signal child status has changed
> SIGIO discard signal I/O is possible on a descriptor
> SIGWINCH discard signal Window size change
> SIGINFO discard signal status request from keyboard
> Right, but anything that does interactive command line editing like bc needs to handle SIGWINCH.
> I'm not seeing the problem on Ventura, which uses the Gavin Howard bc (if perhaps not the same version as on Sonoma, which I don't have).
> Firmly setting the bug in Apple's lap.
> 
> On Aug 11, 2024, at 10:37, Bill Cole <macportsusers-20171215 at billmail.scconsult.com> wrote:
> On 2024-08-11 at 03:08:11 UTC-0400 (Sun, 11 Aug 2024 02:08:11 -0500)
> Ryan Carsten Schmidt <ryandesign at macports.org <mailto:ryandesign at macports.org>>
> is rumored to have said:
> On Aug 11, 2024, at 00:03, Richard L. Hamilton wrote:
> The MacPorts version uses MacPorts supplied libraries (other than libSystem). The macOS version uses macOS supplied libraries. (ultimately from the same open source projects, but potentially different versions and build options, so not identical code)
> It's *not* the same software. MacPorts has GNU bc 1.07 which is licensed GPL-3. macOS used to have GNU bc 1.06 released back in 2000 under GPL-2. Apple has switched to someone else's bc implementation in recent macOS probably because as we know Apple is allergic to GPL-3.
> The macOS bc is Gavin Howard's version which is also used in FreeBSD. It integrates both the GNU additions to the POSIX-standard bc and its own additions, some of which came from the original BSD bc. There has been a steady trickle of bug fixes since the version Apple ships on Sonoma, some of which reference macOS.
> Looking at the man page, I'd bet that exiting when the terminal geometry changes is understandable, since making that change sends a WINCH signal and bc resets on signals for which it has no handler. That gap seems like a bug to me, but one to report to the author or Apple.
> bill at scconsult.com <mailto:bill at scconsult.com> or billcole at apache.org <mailto:billcole at apache.org>
> (AKA @grumpybozo at toad.social <mailto:grumpybozo at toad.social> and many *@billmail.scconsult.com addresses)
> Not Currently Available For Hire
> bill at scconsult.com or billcole at apache.org
> (AKA @grumpybozo at toad.social and many *@billmail.scconsult.com addresses)
> Not Currently Available For Hire
> 



More information about the macports-users mailing list