Git Mailing List Archive mirror
 help / color / mirror / Atom feed
From: <rsbecker@nexbridge.com>
To: "'Rubén Justo'" <rjusto@gmail.com>,
	"'Git List'" <git@vger.kernel.org>,
	"'Junio C Hamano'" <gitster@pobox.com>
Subject: RE: [PATCH v3 1/2] launch_editor: waiting for editor message
Date: Fri, 12 Apr 2024 13:47:16 -0400	[thread overview]
Message-ID: <02ba01da8d01$78bd5a50$6a380ef0$@nexbridge.com> (raw)
In-Reply-To: <f473894d-caf9-4a50-962e-dc884f29e174@gmail.com>

On Friday, April 12, 2024 1:37 PM, Rubén Justo wrote:
>On Fri, Apr 12, 2024 at 01:24:55PM -0400, rsbecker@nexbridge.com wrote:
>> On Friday, April 12, 2024 1:15 PM, Rubén Justo wrote:
>> >Subject: [PATCH v3 1/2] launch_editor: waiting for editor message
>> >
>> >We have a hint shown when we are waiting for user's editor since
>> >abfb04d0c7 (launch_editor(): indicate that Git waits for user input, 2017-12-07).
>> >
>> >After showing the hint, we call start_command() which can return with an error.
>> >Then we'll show "unable to start editor...", after having said
>> >"Waiting for your editor...", which may be confusing.
>> >
>> >Move the code to show the hint below the start_command().
>>
>> My thought on this move is for esoteric (but commonly used) terminal
>> emulators. If one is on a t6530, tn3270, or w3270/9 emulator, for
>> example, the emulator switches modes from text on the POSIX side to
>> block/full screen mode when the editor is launched. Printing a message
>> after the editor has launched has the potential to dump the message
>> into the terminal emulation buffer and get caught in the commit text
>> comment. This is not desirable. This change could have seriously
>> undesirable side-effects.
>
>That's a good point.  Thanks for bringing it up.
>
>Of course, in such a situation the user has the opportunity to disable the hint.
>
>However, can you think of a way in which we could do this, not showing the
>"Waiting..." before the "unable to start", better?

I do not have a good solution. One thought was to run the Waiting message in a separate thread, but that is dangerous. Terminal I/O APIs are generally not thread aware and random results are frequent when writing from two threads, particularly in different processes. Polluting stdout is never a good idea, and in this case the encoding and terminal type could also change between git and editor, even in Linux. The only potential way to do this is with an editor aware mutex (there isn't a portable on) that would block the editor, poll the terminal state, change to UTF-8 or US-ASCII or... and write the Waiting message, switch back, then release the mutex.


  reply	other threads:[~2024-04-12 17:47 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-08 21:02 [PATCH] launch_editor: waiting message on error Rubén Justo
2024-04-08 21:07 ` Rubén Justo
2024-04-08 23:09   ` [PATCH v2] " Rubén Justo
2024-04-09  1:27     ` Junio C Hamano
2024-04-09 23:38       ` Rubén Justo
2024-04-10 15:44         ` Junio C Hamano
2024-04-11 23:18           ` Rubén Justo
2024-04-12 15:46             ` Junio C Hamano
2024-04-12 17:03               ` Rubén Justo
2024-04-12 17:35                 ` Junio C Hamano
2024-04-12 18:24                   ` Rubén Justo
2024-04-12 17:05     ` [PATCH v3 0/2] launch_editor: waiting message Rubén Justo
2024-04-12 17:15       ` [PATCH v3 1/2] launch_editor: waiting for editor message Rubén Justo
2024-04-12 17:24         ` rsbecker
2024-04-12 17:37           ` Rubén Justo
2024-04-12 17:47             ` rsbecker [this message]
2024-04-13 15:06           ` Phillip Wood
2024-04-12 17:15       ` [PATCH v3 2/2] launch_editor: waiting message on error Rubén Justo
2024-04-13 15:09         ` Phillip Wood
2024-04-14  7:23           ` Rubén Justo
2024-04-14  7:39       ` [PATCH v4] " Rubén Justo
2024-04-15 14:05         ` Phillip Wood
2024-04-15 17:03           ` Rubén Justo
2024-04-15 17:20           ` Junio C Hamano
2024-04-15 17:07         ` Rubén Justo
2024-04-15 18:44           ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='02ba01da8d01$78bd5a50$6a380ef0$@nexbridge.com' \
    --to=rsbecker@nexbridge.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=rjusto@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 read-only IMAP folder(s) and NNTP newsgroup(s).