[Tcsh] [UCE] tcsh-6.24.08 is now available

Kimmo Suominen kim at netbsd.org
Sat Apr 15 08:47:47 UTC 2023

[Resending with "reply to all"]

On Sat, 15 Apr 2023 at 02:59, Luke Mewburn <luke at mewburn.net> wrote:
> I'll try and debug further why the original problem exists
> that requires those two tests to be skipped.

A proper fix would be nice, indeed. I just wanted to get
non-interactive builds working as before, and this was the easy way
out. :)

> Possibly related, but I've also noticed other weird edge cases about terminal
> setup on startup that may or may not be related, that could be worth debugging.

sh.c from line 1095 onwards:
- if (intty = isatty(SHIN)) returns zero, "edit" is unset
- intty |= intact; /* "tcsh -i" */

sh.c from line 1378 onwards:
- if (intty && !targinp) { ed_Init(); } /* "tcsh -c" sets targinp */

It is ed_Init() that would call GetTermCaps() during shell startup.

If GetTermCaps() has not been done (!GotTermCaps), telltc (and echotc
and settc) will also call GetTermCaps().

As for reproducing the "non-interactive" nature with setsid(1) on
Debian (so isatty(3) returns different things):

> setsid -w sh -c 'TERM=something tcsh -f -c '"'"'echo $?edit'"'"
> setsid -w sh -c 'TERM=something tcsh -f -c '"'"'echo $?edit'"'" < /dev/null
> setsid -w sh -c 'tcsh -f -c "echo #no comment"'
#no comment
> setsid -w sh -c 'tcsh -f -c "echo #no comment"' < /dev/null


I understand the "$edit" case, but I don't understand the "#no comment" case.

Kind regards,
+ Kimmo

More information about the Tcsh mailing list