zsh-workers
 help / color / mirror / code / Atom feed
* STTY fails to reset ICRNL / INLCR
@ 2024-04-18  5:13 Ronan Pigott
  2024-04-19  2:46 ` Bart Schaefer
  0 siblings, 1 reply; 4+ messages in thread
From: Ronan Pigott @ 2024-04-18  5:13 UTC (permalink / raw)
  To: zsh-workers

Hi zsh,

The following appears to be a bug:

  $ zsh --version
  zsh 5.9 (x86_64-pc-linux-gnu)
  $ uname -r
  6.8.7-arch1-1
  
  $ reset
  $ STTY={-icanon,-echo} xxd -ps -l3 # input Ctrl-J, Ctrl-M, Return
  0a0a0a
  $ STTY={-icanon,-echo,icrnl,inlcr} xxd -ps -l3 # input Ctrl-J, Ctrl-M, Return
  0d0a0a
  $ STTY={-icanon,-echo} xxd -ps -l3 # input Ctrl-J, Ctrl-M, Return
  0d0a0a

The STTY parameter description in zshparam(1):

> If this parameter is set in a command's environment, the shell runs the stty
> command with the value of this parameter as arguments in order to set up the
> terminal before executing the command. The modes apply only to the command,
> and are reset when it finishes or is suspended.

But as you can see, INLCR was not reset.

Cheers,

Ronan


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: STTY fails to reset ICRNL / INLCR
  2024-04-18  5:13 STTY fails to reset ICRNL / INLCR Ronan Pigott
@ 2024-04-19  2:46 ` Bart Schaefer
  2024-04-19  2:53   ` Ronan Pigott
  0 siblings, 1 reply; 4+ messages in thread
From: Bart Schaefer @ 2024-04-19  2:46 UTC (permalink / raw)
  To: Ronan Pigott; +Cc: zsh-workers

[-- Attachment #1: Type: text/plain, Size: 748 bytes --]

On Wed, Apr 17, 2024 at 10:13 PM Ronan Pigott <ronan@rjp.ie> wrote:

>
>   $ zsh --version
>   zsh 5.9 (x86_64-pc-linux-gnu)
>   $ uname -r
>   6.8.7-arch1-1
>

I can't reproduce with the current git master.

% echo $ZSH_PATCHLEVEL
zsh-5.9-437-ga66e929
% uname -vr
5.15.0-102-generic #112~20.04.1-Ubuntu SMP Thu Mar 14 14:28:24 UTC 2024
% xxd -ps -l3

0a
0a
0a
% STTY={-icanon,-echo} xxd -ps -l3
0a0a0a
% STTY={-icanon,-echo,icrnl,inlcr} xxd -ps -l3
0d0a0a
% STTY={-icanon,-echo} xxd -ps -l3
0a0a0a
%

The only way I can something similar happen is by running the last two xxd
commands without allowing a prompt to be printed in between.  Zsh only
resets the terminal at each new prompt, not at every command exit.

[-- Attachment #2: Type: text/html, Size: 1108 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: STTY fails to reset ICRNL / INLCR
  2024-04-19  2:46 ` Bart Schaefer
@ 2024-04-19  2:53   ` Ronan Pigott
  2024-04-19 20:14     ` Ronan Pigott
  0 siblings, 1 reply; 4+ messages in thread
From: Ronan Pigott @ 2024-04-19  2:53 UTC (permalink / raw)
  To: Bart Schaefer; +Cc: zsh-workers

April 18, 2024 at 7:46 PM, "Bart Schaefer" <schaefer@brasslantern.com> wrote:
 
> I can't reproduce with the current git master.

Hm I probably should have tested it before, but I actually can't reproduce
with zsh -f either using 5.9.

I'll see if I can determine the cause.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: STTY fails to reset ICRNL / INLCR
  2024-04-19  2:53   ` Ronan Pigott
@ 2024-04-19 20:14     ` Ronan Pigott
  0 siblings, 0 replies; 4+ messages in thread
From: Ronan Pigott @ 2024-04-19 20:14 UTC (permalink / raw)
  To: Bart Schaefer; +Cc: zsh-workers

Hm, well, I can't actually reproduce with my normal zshrc either.

But I swear it reproduced easily many times the other day... I was even
suspicious it might be something transient and threw in the reset to be sure!

Just ignore this for now, if it shows up to bother me again, I'll look harder
for the cause.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-04-19 20:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-18  5:13 STTY fails to reset ICRNL / INLCR Ronan Pigott
2024-04-19  2:46 ` Bart Schaefer
2024-04-19  2:53   ` Ronan Pigott
2024-04-19 20:14     ` Ronan Pigott

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).