This looks great, thanks!

On Nov 16, 2017 3:20 AM, "Nicholas Marriott" <[email protected]>
wrote:

> Thanks.
>
> I have applied this, but I thought it was better to put the x-y and
> x-y-and-cancel in the same if() block so I have changed to do that. Let
> me know if you see any mistakes.
>
> I didn't change the default keys. I don't want non-mouse default keys in
> the root table. I don't mind having bindings for S-NPage and S-PPage in
> copy mode though but you will need to add both I think.
>
> The changes should be GitHub next time it syncs up in an hour or so.
>
>
> On Wed, Nov 15, 2017 at 07:09:15PM -0800, Stephen Hicks wrote:
> >    I've added the documentation.
> >    I also went ahead and added S-PageUp and S-PageDown bindings to the
> >    default keymap, the latter of which uses page-down-and-cancel.A  This
> >    mirrors the scrollback behavior of xterm and standard linux TTYs, and
> >    should therefore be natural for many users (provided their terminals
> send
> >    those keys in the first place).A  If you want, I can revert that
> change.
> >    On Sat, Nov 11, 2017 at 1:33 PM, Nicholas Marriott
> >    <[email protected]> wrote:
> >
> >      thanks. you also need to add these to tmux.1
> >
> >      On Fri, Nov 10, 2017 at 02:53:26PM -0800, Stephen Hicks wrote:
> >      >A  A  Sorry for the delay.AA  I've redone the patch to instead
> provide
> >      the
> >      >A  A  -and-cancel versions of the three relevant commands
> >      >A  A  (cursor-down-and-cancel doesn't seem to make sense, in my
> >      opinion, nor
> >      >A  A  does it currently respect the copy-mode -e flag).
> >      >A  A  On Mon, Oct 30, 2017 at 12:51 AM, Nicholas Marriott
> >      >A  A  <[email protected]> wrote:
> >      >
> >      >A  A  A  OK well we can just leave -e for the moment and have the
> new
> >      commands as
> >      >A  A  A  well assuming the new diff is pretty small.
> >      >
> >      >A  A  A  On Mon, Oct 30, 2017 at 03:50:15PM +1100, Cam Hutchison
> wrote:
> >      >A  A  A  > Yes, I have Prefix-[ and Prefix-^[ set to copy-mode, and
> >      >A  A  A  > MouseDrag1Pane, WheelUpPane and "-T root PPage" using
> >      copy-mode -e.
> >      >A  A  A  >
> >      >A  A  A  > On 29 October 2017 at 19:34, Nicholas Marriott
> >      >A  A  A  > <[email protected]> wrote:
> >      >A  A  A  > > Have you got some key bindings that do copy-mode -e
> and
> >      some that
> >      >A  A  A  just
> >      >A  A  A  > > do plain copy-mode?
> >      >A  A  A  > >
> >      >A  A  A  > >
> >      >A  A  A  > >
> >      >A  A  A  > > On Sun, Oct 29, 2017 at 01:17:37PM +1100, Cam
> Hutchison
> >      wrote:
> >      >A  A  A  > >> Stephen,
> >      >A  A  A  > >>
> >      >A  A  A  > >> Sorry for the delay in responding - life got in the
> >      way...
> >      >A  A  A  > >>
> >      >A  A  A  > >> Stephen Hicks wrote:
> >      >A  A  A  > >> > In my mind, those two models are not mutually
> >      exclusive.AA  When I
> >      >A  A  A  use the
> >      >A  A  A  > >> > mouse wheel to initiate a scrollback, I do tend to
> be
> >      in the
> >      >A  A  A  second model,
> >      >A  A  A  > >> > but on the keyboard, how I enter copy mode is more
> >      related to
> >      >A  A  A  whether the
> >      >A  A  A  > >> > thing I'm looking for is on the screen or not, in
> >      addition to
> >      >A  A  A  whether I'm
> >      >A  A  A  > >> > searching, scrolling, or copying.
> >      >A  A  A  > >>
> >      >A  A  A  > >> No, not mutually exclusive but when nicm said to also
> >      remove the -e
> >      >A  A  A  > >> option, I didn't see how your proposed changes would
> >      allow me to
> >      >A  A  A  retain
> >      >A  A  A  > >> the mode I ues.
> >      >A  A  A  > >>
> >      >A  A  A  > >> > My setting looks roughly like this:
> >      >A  A  A  > >> >
> >      >A  A  A  > >> > bind [ copy-mode
> >      >A  A  A  > >> > bind -n S-PgUp copy-mode -u
> >      >A  A  A  > >> > bind -T copy-mode PgUp send-keys -X page-up
> >      >A  A  A  > >> > bind -T copy-mode S-PgUp send-keys -X page-up
> >      >A  A  A  > >> > bind -T copy-mode PgDn send-keys -X page-down
> >      >A  A  A  > >> > bind -T copy-mode S-PgDn send-keys -X
> >      page-down-maybe-cancel
> >      >A  A  A  > >>
> >      >A  A  A  > >> I wonder if a simpler way would be to define two new
> copy
> >      mode
> >      >A  A  A  commands,
> >      >A  A  A  > >> autoexit-on and autoexit-off. It's not quite ideal
> as two
> >      commands,
> >      >A  A  A  as
> >      >A  A  A  > >> it smells more like an option but there are no pane
> >      options or copy
> >      >A  A  A  mode
> >      >A  A  A  > >> options.
> >      >A  A  A  > >>
> >      >A  A  A  > >> With these two commands, you could replace
> 'copy-mode -e'
> >      with
> >      >A  A  A  > >> 'copy-mode; send-keys -X autoexit-on' and you could
> >      replace your
> >      >A  A  A  > >> bindings with a similar sequence that sends
> autoexit-off
> >      then
> >      >A  A  A  page-down,
> >      >A  A  A  > >> or autoexit-on then page-down, etc.
> >      >A  A  A  > >>
> >      >A  A  A  > >> That is, give control of the basic components needed
> to
> >      compose the
> >      >A  A  A  > >> higher-level behaviour.
> >      >A  A  A  > >>
> >      >A  A  A  > >> I'd be happy with getting rid of copy-mode -e with
> >      something like
> >      >A  A  A  this
> >      >A  A  A  > >>
> >      >A  A  A  > >> If I seem a little defensive of copy-mode -e its
> because
> >      I added it
> >      >A  A  A  :-)
> >      >A  A  A  > >>
> >      >A  A  A  > >> Cheers,
> >      >A  A  A  > >> Cam
> >      >A  A  A  > >>
> >      >A  A  A  > >> > On Wed, Oct 25, 2017 at 7:37 PM, Cam Hutchison
> >      <[email protected]>
> >      >A  A  A  wrote:
> >      >A  A  A  > >> >
> >      >A  A  A  > >> > > On 26 October 2017 at 05:39, Stephen Hicks
> >      >A  A  A  <[email protected]> wrote:
> >      >A  A  A  > >> > > > I appreciate the patch that went in a while
> back to
> >      add
> >      >A  A  A  "copy-mode -e",
> >      >A  A  A  > >> > > > allowing to automatically exit copy-mode when
> >      reaching the
> >      >A  A  A  bottom of the
> >      >A  A  A  > >> > > > buffer.AA  But I find that this functionality
> is a
> >      bit of
> >      >A  A  A  "spooky action
> >      >A  A  A  > >> > > at a
> >      >A  A  A  > >> > > > distance": the decision to exit depends not on
> the
> >      input the
> >      >A  A  A  caused the
> >      >A  A  A  > >> > > > scroll-down, but instead of the input that
> >      initially scrolled
> >      >A  A  A  up.
> >      >A  A  A  > >> > >
> >      >A  A  A  > >> > > I'm not sure I understand your use case or your
> issue
> >      with the
> >      >A  A  A  current
> >      >A  A  A  > >> > > behaviour. Is it just the "spooky action at a
> >      distance" that
> >      >A  A  A  you object to?
> >      >A  A  A  > >> > >
> >      >A  A  A  > >> > > The current behaviour is intended to model two
> >      different ways
> >      >A  A  A  that copy
> >      >A  A  A  > >> > > mode can be used:
> >      >A  A  A  > >> > >
> >      >A  A  A  > >> > > 1) The normal mode where you are copying data
> out of
> >      the
> >      >A  A  A  scrollback
> >      >A  A  A  > >> > > buffer, searching through it, or some other
> explicit
> >      action.
> >      >A  A  A  This mode
> >      >A  A  A  > >> > > requires you to take an equally explicit action
> to
> >      exit.
> >      >A  A  A  > >> > >
> >      >A  A  A  > >> > > 2) Scrollback mode, where you are just scrolling
> back
> >      through
> >      >A  A  A  the
> >      >A  A  A  > >> > > terminal history. In this mode, you enter
> typically
> >      with just a
> >      >A  A  A  PageUp
> >      >A  A  A  > >> > > or ScrollUp event, not a binding that is
> explicitly
> >      copy-mode.
> >      >A  A  A  This
> >      >A  A  A  > >> > > way, exiting mirrors your entry - when you scroll
> >      back to where
> >      >A  A  A  you
> >      >A  A  A  > >> > > started, you're no longer in copy mode.
> >      >A  A  A  > >> > >
> >      >A  A  A  > >> > > I don't understand the "spooky action at a
> distance"
> >      (I get
> >      >A  A  A  that how you
> >      >A  A  A  > >> > > enter the mode defines how you can exit the
> mode, but
> >      that's
> >      >A  A  A  all related
> >      >A  A  A  > >> > > and not spooky unrelated stuff, or at a
> distance).
> >      >A  A  A  > >> > >
> >      >A  A  A  > >> > > I can't see how your approach allows the
> distinction
> >      between
> >      >A  A  A  these two
> >      >A  A  A  > >> > > use cases to be retained. Perhaps using separate
> key
> >      tables,
> >      >A  A  A  but that
> >      >A  A  A  > >> > > feels like a lot of extra configuration.
> >      >A  A  A  > >> > >
> >      >A  A  A  > >> > > Can you explain why you want to change this?
> >      >A  A  A  > >> > >
> >      >A  A  A  > >> > > >
> >      >A  A  A  > >> > > > I've put together a small patch to allow opting
> >      into the
> >      >A  A  A  auto-exit
> >      >A  A  A  > >> > > behavior
> >      >A  A  A  > >> > > > on scroll-down commands instead.AA  Currently
> I've
> >      overloaded
> >      >A  A  A  the
> >      >A  A  A  > >> > > send-keys -R
> >      >A  A  A  > >> > > > argument (which seems somewhat appropriate
> given
> >      that exiting
> >      >A  A  A  copy-mode
> >      >A  A  A  > >> > > is a
> >      >A  A  A  > >> > > > sort of "reset"), but I'd also be happy to
> find a
> >      different
> >      >A  A  A  way to pass
> >      >A  A  A  > >> > > the
> >      >A  A  A  > >> > > > option (either adding an additional argument to
> >      send-keys, or
> >      >A  A  A  adding
> >      >A  A  A  > >> > > > scroll-down, etc, to the 1-arg branch so that
> you'd
> >      write
> >      >A  A  A  "send-keys -X
> >      >A  A  A  > >> > > > scroll-down -e", though in that case I'm not
> sure
> >      what to do
> >      >A  A  A  if the
> >      >A  A  A  > >> > > argument
> >      >A  A  A  > >> > > > is anything *other* than -e - currently it
> silently
> >      does
> >      >A  A  A  nothing if a
> >      >A  A  A  > >> > > > command has the wrong (number of) arguments,
> which
> >      isn't
> >      >A  A  A  great.
> >      >A  A  A  > >> > > >
> >      >A  A  A  > >> > > > Please let me know how to proceed so that this
> >      functionality
> >      >A  A  A  can be
> >      >A  A  A  > >> > > added.
> >      >A  A  A  > >> > > > Or if you'd rather continue on a GitHub pull
> >      request, that
> >      >A  A  A  would be
> >      >A  A  A  > >> > > great as
> >      >A  A  A  > >> > > > well.
> >      >A  A  A  > >> > > >
> >      >A  A  A  > >> > > > Thanks!
> >      >A  A  A  > >> > > > steve
> >      >A  A  A  > >> > > >
> >      >A  A  A  > >> > > > --
> >      >A  A  A  > >> > > > You received this message because you are
> >      subscribed to the
> >      >A  A  A  Google Groups
> >      >A  A  A  > >> > > > "tmux-users" group.
> >      >A  A  A  > >> > > > To unsubscribe from this group and stop
> receiving
> >      emails from
> >      >A  A  A  it, send an
> >      >A  A  A  > >> > > > email to tmux-users+unsubscribe@
> googlegroups.com.
> >      >A  A  A  > >> > > > To post to this group, send email to
> >      >A  A  A  [email protected].
> >      >A  A  A  > >> > > > For more options, visit
> >      https://groups.google.com/d/optout.
> >      >A  A  A  > >> > >
> >      >A  A  A  > >>
> >      >A  A  A  > >> --
> >      >A  A  A  > >> You received this message because you are subscribed
> to
> >      the Google
> >      >A  A  A  Groups "tmux-users" group.
> >      >A  A  A  > >> To unsubscribe from this group and stop receiving
> emails
> >      from it,
> >      >A  A  A  send an email to [email protected].
> >      >A  A  A  > >> To post to this group, send an email to
> >      >A  A  A  [email protected].
> >      >A  A  A  > >> For more options, visit
> >      https://groups.google.com/d/optout.
> >      >A  A  A  > >
> >      >A  A  A  > > --
> >      >A  A  A  > > You received this message because you are subscribed
> to
> >      the Google
> >      >A  A  A  Groups "tmux-users" group.
> >      >A  A  A  > > To unsubscribe from this group and stop receiving
> emails
> >      from it,
> >      >A  A  A  send an email to [email protected].
> >      >A  A  A  > > To post to this group, send an email to
> >      [email protected].
> >      >A  A  A  > > For more options, visit
> >      https://groups.google.com/d/optout.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"tmux-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to