From nobody Sun Nov 02 09:35:13 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 4czqMR17kLz6FNfD for ; Sun, 02 Nov 2025 09:35:31 +0000 (UTC) (envelope-from tschweikle@gmail.com) Received: from mail-qv1-xf33.google.com (mail-qv1-xf33.google.com [IPv6:2607:f8b0:4864:20::f33]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4czqMQ5yTsz3CQy for ; Sun, 02 Nov 2025 09:35:30 +0000 (UTC) (envelope-from tschweikle@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-qv1-xf33.google.com with SMTP id 6a1803df08f44-87499a3cd37so26696546d6.3 for ; Sun, 02 Nov 2025 01:35:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1762076125; x=1762680925; darn=freebsd.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=RA3IaL1m8hWgqbaIV7QlK6xbbPsYh5ZLKBuB9e8zEAg=; b=mA8qK0R47C4zEZ9LlzatfcDEPGVRBOVRh/0zotVra1Jn5DiLl9rApYKn8JdX38Vhed r08GG1JJFGxLZqsM8QnchF0vszOge4cWf5lPlv3ql5bT/4FsTwSX7lSSrCr06HLmDXnP cJHDzHQX5kyToxuOzoFE16tdq4oDgp1I9S3n3M1y7scwHxVCh8B8IypoI4fmEMoKVe0g oc81fEXw5v9yhTbDCJiJa+tFHbZTJQMKX4xMqEYbNA1CkrVIlbqHlg89qt9z8rkY7RZd bz2mjNse5Wya4QVnDDioKdmEnRs646fGTxf4NeMyu4G3RdB554SX9qOc7Y/33i+fEJk0 mK8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762076125; x=1762680925; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=RA3IaL1m8hWgqbaIV7QlK6xbbPsYh5ZLKBuB9e8zEAg=; b=HxqKgmCPdS1ss84JjYizIZSRimOo8E1k8LfT24vBEq98GLK5uxmMbZN9nUbvDIz8z9 3ZuBYfw3MnWy0vrDtFVb2jAgY5G5HJJK20koY8nRw2at10xViakH0qOvRns6sfGiNwv4 fb2gdA9EgyAUJ5dZI6FgWDfxHA6Dcod4exE1kvA1KoPIUX7UNZpOgXSoquO1D5YvDc1b y9YWO9riDhE8/BOTKYD4vN8TnSE2T1bfc/VcymFH7nqAwvD5tNtLFhnRlCAP2VvQXx8/ NP4LUEKmJFbiiBMf7cfTOgjccJfQQZ69RZTVyxtyfeINONb8wgZFhLNplfGVTqPi5f4w xz5w== X-Forwarded-Encrypted: i=1; AJvYcCV66wN4sqFe5ntrypp91C3JpJI1A3ppB/RS2JWNoJQ0dhO2VBBOmVvWL9z/Essj5Nqne5cvMx2iGn/bEBYy1GQ=@freebsd.org X-Gm-Message-State: AOJu0YyxVnrMQmu8hVe5vfZv146XMgIplhlQjxRMeA+/EXkr8AJ4Ix+M znNUv0kpPAvJuqdA93jGErsPiF+ZLF2G1D2awU1PHEJ7RzFTEsBueyI7Y6YDqIlpY00oVklmCe/ Q5gt/+6GG4dBG8ze0aWzE2V+H5Ev00KY= X-Gm-Gg: ASbGncumQXVgdfoNsywcfTUiSuWmsOw0trXrIe6Y3e1bIZc+Y1i/jQzCko+1vrNaf0Y PAT2MW5ctclRucz+8imMGefWai0frCIn+fYLZ3GlP7hwtXy/Qjc8WL/2ovG0PPtcDLAvF18ScwK fyRNSnQQwAH5NeeLqjkTvrNCTcwnf0OWvyALl03iUAU/5b4u1xrwyqzTtTkCJAIjllTxZtuvPuI TY3IEjwL43g2fkr0R1cpC8gni+us3SNEvufvh3dDH+nfiFmWmDYMxhOlTKQJSe8UHSQjEPBGa6Q faAHuKkJo0phqVGJUOd6aUTUOHNc54WpS55pauHu0ghg4wG0ot+aptoJ8dtVP288ivp+sMMwFsX EFI/ZSl0jffL1uA== X-Google-Smtp-Source: AGHT+IGcKWU0Waf01AwT7NeLsYx6Ob/tLotsaPpxH2xe5QrH9xgJ8qO5BuNHQTOycJD8D+PpACj/4NZa4IT5oVwXbWM= X-Received: by 2002:ad4:5f45:0:b0:87d:c94a:17ec with SMTP id 6a1803df08f44-8802f4e1762mr112676736d6.57.1762076124868; Sun, 02 Nov 2025 01:35:24 -0800 (PST) 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 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> In-Reply-To: From: Thomas Schweikle Date: Sun, 2 Nov 2025 10:35:13 +0100 X-Gm-Features: AWmQ_blPF7CG8Q7P2f0dAgBcAGma0AE1Ew_9sbRmPxc7RmJj2iy42QgKfjtsqzE Message-ID: Subject: Re: a really big question : why not "^C" for a CTRL-C with default /bin/sh ? To: Konstantin Belousov Cc: Warner Losh , Dennis Clarke , freebsd-current@freebsd.org Content-Type: multipart/alternative; boundary="0000000000007d770c0642995175" X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Rspamd-Queue-Id: 4czqMQ5yTsz3CQy --0000000000007d770c0642995175 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable It depends. It depends on what *BSD you are using with which shell. it is different for different Gnu/Linux based distributions. Pauschally telling it prints "CTRL-C" als "^C" in any cases if wrong. As told: it depends on what *NIX you are operating which shell. Sometimes even bash prints typed CTRL-C as ^C, sometimes it just does only for keys not bound to anything. Looking at involved programs and libraries configurations, they are different on these systems. And it is quite difficult to transfer one configuration from one system to another, without breaking something you'd never imagined. I'd say it is mostly configuration if CTRL-C is printed as ^C or not. On Sun, Nov 2, 2025 at 6:39=E2=80=AFAM Konstantin Belousov wrote: > On Sat, Nov 01, 2025 at 10:44:54PM -0600, Warner Losh wrote: > > On Sat, Nov 1, 2025 at 7:49=E2=80=AFPM 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: > > > >>>> > > > >>>> =EF=BB=BF > > > >>>> This is about as annoying as a small sharp stone stuck in a shoe= : > > > >>>> > > > >> ... > > > >>> Wasn=E2=80=98t 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. > > --=20 Thomas --0000000000007d770c0642995175 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
It depends. It depends on what *BSD you are using with whi= ch shell. it is different for different Gnu/Linux based distributions. Paus= chally telling it prints "CTRL-C" als "^C" in any cases= if wrong. As told: it depends on what *NIX you are operating which shell. = Sometimes even bash prints typed CTRL-C as ^C, sometimes it just does only = for keys not bound to anything. Looking at involved programs and libraries = configurations, they are different on these systems. And it is quite diffic= ult to transfer one configuration from one system to another, without break= ing something you'd never imagined.
I'd say it is mostly config= uration if CTRL-C is printed as ^C or not.

On Su= n, Nov 2, 2025 at 6:39=E2=80=AFAM Konstantin Belousov <kostikbel@gmail.com> wrote:
On Sat, Nov 01, 2025 at 10:44:54PM= -0600, Warner Losh wrote:
> On Sat, Nov 1, 2025 at 7:49=E2=80=AFPM Dennis Clarke <dclarke@blastwave.org>= 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 <dclarke@blastwave.or= g>
> > wrote:
> > >>>>
> > >>>> =EF=BB=BF
> > >>>> This is about as annoying as a small sharp stone= stuck in a shoe :
> > >>>>
> > >> ...
> > >>> Wasn=E2=80=98t 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 la= st four decades.
> > >
> > > zsh does, ksh93 (illumos) does.
> > >
> >
> > Those both hide the CTRL-C "^C" chars ?
> >
> > Oracle Solaris 11.4.81.193.1=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Assembled April 2025
> > n$
> > n$ uname -a
> > SunOS neptune 5.11 11.4.81.193.1 sun4v sparc sun4v non-virtualize= d
> > 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=C2=A0 ^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<return> and then ^C.

When the terminal in the canonical mode, kernel prints ^C for Ctrl-C
input, as you noted for cat.=C2=A0 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.



--
Thomas
--0000000000007d770c0642995175--