Re: [hackers] [st][PATCH] reset the cursor shape to the default with DECSCUSR param 0

From: Koichi Murase <myoga.murase_AT_gmail.com>
Date: Wed, 7 Sep 2022 09:14:09 +0900

2022年9月7日(水) 3:23 Hiltjo Posthuma <hiltjo_AT_codemadness.org>:
> Hi,

Hi, thank you for your reply. Maybe I might not get your point, so
please forgive me that my reply becomes longer.

> I looked at the _references_. But you should first and foremost describe the issue
> clearly.

I actually thought the commit message of the first post explains the
issue clearly. The behavior of xterm is irrelevant to judging which
behavior should be preferred because xterm's behavior is consistent
with both interpretations, i.e., "0,1: always blinking block" vs "0:
default, 1: blinking block".

> Can you answer my questions directly?

Yes, sure.

Maybe I miss some emails, but I don't seem to receive concrete
questions from you except for the following one:

>> Are you sure it is correct?

In case you have sent another email that includes the questions, I'm
sorry but could you send it again?

To answer the above question: Yes, why not? I wouldn't have submitted
a patch if I would think it is incorrect. But I actually think that
the answer could actually depend on what "it" specifically indicates
and how we define "correctness".

By my above answer, I mean I believe that it is the correct direction
that terminal emulators converge in the behavior that param 0 sets the
cursor shape to the default one. Xterm does not conflict with it
because the default cursor shape is fixed to the blinking block.
Similarly, the documented behavior of the VT terminals does not
conflict with it with the default user configuration. The VT behavior
with the custom user settings might conflict with it but no one has
tested it whether it really conflicts. As far as I tested, all the
terminal emulators allowing the custom default cursor shape except for
xterm.js and st also behave as "0: default", i.e., reset the cursor
shape to the configured default cursor shape. The developers of
xterm.js (which is an independent implementation despite its name)
agreed to change its behavior to "0: default" and are waiting for a
contribution in [2] (tagged with "good-first-issue"). The terminals
that I tested are vte (GNOME terminal), Alacritty, Windows Terminal,
mintty, and RLogin. I have also checked xterm, mlterm, and
terminology, but I couldn't find an option to change the default
cursor shape of these terminals, so the behavior of these terminals
seems to be compatible with both interpretations. Maybe I need to
confirm them at the source code level and also check more terminals;
If you request me to do so, please let me know.

If you are asking about the consistency with xterm, I have already
answered it in the previous reply in the statement starting with "This
is just because xterm doesn't allow configuring ...."

If you are talking about other points, could you describe in more
detail what "it" means and how you defined "correctness" in your
question? I'll think about it and try to answer it.

> The referenced comment in the vt code has assumptions which are likely false.

May I ask why you think these assumptions are "likely false"? Do you
have real VT machines? To me, it just seems 50/50% because there
doesn't seem to be a reliable way to test it other than trying it on
real implementations. Nevertheless, Ref. [1] shows the fact that vte
has chosen the option "0: default". Other terminal emulators are also
consistent with "0: default", I believe "0: default" is a more
reasonable design, and it is also consistent with the typical meaning
of param 0 of other terminal control sequences. I'm actually not sure
what st aims at here, but if the VT behavior can be confirmed with
real machines and st aims at exactly replicating the VT behavior even
when it becomes incompatible with the other terminals, I'm fine with
keeping the current behavior of st.

> They have not even tested xterm it seems.

It seems to me that it is because testing xterm doesn't give any
information because xterm doesn't allow changing the default cursor
shape. Maybe I miss some points, what would you discuss by testing the
behavior of xterm?

> To me it looks xterm is doing the right thing.

Yes, but the behavior of xterm is consistent with both interpretations
because xterm does not allow users to change the default cursor shape.
I.e., both statements that xterm changes the cursor shape to the
default one by param 0 and that xterm changes it to the blinking block
cursor.

--
Koichi
Received on Wed Sep 07 2022 - 02:14:09 CEST

This archive was generated by hypermail 2.3.0 : Wed Sep 07 2022 - 02:24:35 CEST