From nobody Sun Nov 2 05:39:26 2025 X-Original-To: freebsd-current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4czk7P5TPXz6G1g3 for ; Sun, 02 Nov 2025 05:39:45 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4czk7P0RVpz3mFD for ; Sun, 02 Nov 2025 05:39:44 +0000 (UTC) (envelope-from kostikbel@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: from tom.home (kib@localhost [127.0.0.1] (may be forged)) by kib.kiev.ua (8.18.1/8.18.1) with ESMTP id 5A25dRCt087973; Sun, 2 Nov 2025 07:39:30 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 5A25dRCt087973 Received: (from kostik@localhost) by tom.home (8.18.1/8.18.1/Submit) id 5A25dRRN087972; Sun, 2 Nov 2025 07:39:27 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 2 Nov 2025 07:39:26 +0200 From: Konstantin Belousov To: Warner Losh Cc: Dennis Clarke , freebsd-current@freebsd.org Subject: Re: a really big question : why not "^C" for a CTRL-C with default /bin/sh ? Message-ID: References: <864EE1FC-1533-47D4-A395-C24F25269EE0@freebsd.org> <342c6a91-a8a1-483d-861e-8e8c6d79998f@blastwave.org> <9ea41e44-7160-40eb-9d80-b8bf13a7f396@mm.st> <0c09c6fa-7071-4119-b97e-fc6d83f9fc3f@blastwave.org> List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on tom.home X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Rspamd-Queue-Id: 4czk7P0RVpz3mFD On Sat, Nov 01, 2025 at 10:44:54PM -0600, Warner Losh wrote: > On Sat, Nov 1, 2025 at 7:49 PM Dennis Clarke wrote: > > > On 11/1/25 21:22, cyric@mm.st wrote: > > > Dennis Clarke wrote: > > >> On 11/1/25 20:30, Michael Gmelin wrote: > > >>> > > >>> > > >>>> On 2. Nov 2025, at 00:34, Dennis Clarke > > wrote: > > >>>> > > >>>>  > > >>>> This is about as annoying as a small sharp stone stuck in a shoe : > > >>>> > > >> ... > > >>> Wasn‘t this always the default behavior in /bin/sh? > > >>> > > >> > > >> If it was and if it is then it is broken and always has been. > > >> > > >> No UNIX shell *ever* behaves this way in at least the last four decades. > > > > > > zsh does, ksh93 (illumos) does. > > > > > > > Those both hide the CTRL-C "^C" chars ? > > > > Oracle Solaris 11.4.81.193.1 Assembled April 2025 > > n$ > > n$ uname -a > > SunOS neptune 5.11 11.4.81.193.1 sun4v sparc sun4v non-virtualized > > n$ echo $SHELL > > /usr/xpg4/bin/sh > > n$ > > n$ ls la la la la la ^C > > n$ > > n$ which ksh93 > > /usr/bin/ksh93 > > n$ > > n$ ksh93 > > dclarke@neptune:~$ > > dclarke@neptune:~$ and then we have Dave Korn > > dclarke@neptune:~$ well look ... no CTRL-C ^C chars ? > > > > dclarke@neptune:~$ > > > > Nice one. I did not recall the ksh93 issue. Must be something in the > > stty options being set or unset. > > > > tcsh doesn't report it at the prompt (most likely because libedit is in > play), but does if you type cat and then ^C. When the terminal in the canonical mode, kernel prints ^C for Ctrl-C input, as you noted for cat. There are a lot of termios controls that combined give that behavior, like isig etc. When the terminal is in raw mode, as set by shells with more than basic line editing capabilities, kernel does not output anything on Ctrl-C, and shells or rather libedit do not bother. Spawning the command, shells switch the ctty into the canonical mode, this is why tcsh+cat behaves that way. BTW, it seems bash (readline) does print ^C.