9front - general discussion about 9front
 help / color / mirror / Atom feed
From: unobe@cpan.org
To: 9front@9front.org
Subject: Re: [9front] vt: fix scrolling over ssh, add mouse scrolling
Date: Fri, 25 Jun 2021 23:04:20 -0700	[thread overview]
Message-ID: <CDF6ECED1EC42F95A0E8EFA569915A69@smtp.pobox.com> (raw)
In-Reply-To: <16E08562D70F59B59716B917E13062F4@eigenstate.org>

Quoth ori@eigenstate.org:
> Testing requested.
> 
> We were setting 'resize_flag = 1' in backup(), which was
> causing resized() to get called, which was causing us to
> call exportsize(), which was eventually singalling sshd,
> which forwarded the signal over to the process on the
> other end of the ssh pipe.
> 
> This was causing a SIGINT to get sent, which was screwing
> up the scrolling.

Reviewing the logic of what resize_flag does, your patch makes sense:
when can you ever resize the window when scrolling/paging back or
forward?  I don't see how that can be done simultaneously, but maybe
there's something else afoot.

I want to make sure I understand what you're experiencing so I can
test it properly.  Here's what I've pieced togeter without running
anything:

1.  You start vt(1)

2.  You ssh(1) into a foreign host.  Since vt(1) sets the TERM
environment variable, raw mode is on in ssh(1), which sets the vt(1)
console winch to 1 @ /sys/src/cmd/vt/fs.c:/winchon due to the write @
/sys/src/cmd/ssh.c:/^rawon .

3.  You start a long-running process that spews a lot of text.

4.  You then use 'backup'.  That signals to the foreign host to set
the environment variables, which is performed.  No problem there.

5.  However, at the end of exportsize() an interrupt is sent because
ssh(1) had set winch to 1:
	if(cs->winch)
		send_interrupt();
   Thus the problem?

Related to this, I see resize_flag is set to 1 in only one other
scenario, and that deals with the page menu item and when blocked is
true.  Blocked is only set to 1 in /sys/src/cmd/vt/main.c:^newline
from what I see.  That's only done after newline() is called in
/sys/src/cmd/vt/vt.c and only when:

a) pagemode is true; and

b) the number of lines goes beyond the screen size max.

So perhaps the resize_flag set to 1 for 'backup' is to handle a
special case that we're not aware of currently?  Maybe ssh.c is being
too aggressive in setting winchon? Or maybe your fix is the best.


      parent reply	other threads:[~2021-06-26 15:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-24  4:00 ori
2021-06-24  7:28 ` igor
2021-06-24 13:34   ` ori
2021-06-24 14:22     ` igor
2021-06-26  6:04 ` unobe [this message]

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=CDF6ECED1EC42F95A0E8EFA569915A69@smtp.pobox.com \
    --to=unobe@cpan.org \
    --cc=9front@9front.org \
    /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 NNTP newsgroup(s).