On Thu, Jan 05, 2017 at 03:25:29PM +0100, Trygve Aaberge wrote:

> I'm experiencing an issue when using aliases for commands that open the pager.
> When I press Ctrl-c from the pager, it exits. This does not happen when I
> don't use an alias and did not happen before. It causes problems because
> Ctrl-c is also used for other things, such as canceling a search that hasn't
> completed.
> 
> To reproduce, create e.g. the alias `l = log` and run `git l`. Then press
> Ctrl-c. The expected behavior is that nothing happens. The actual behavior is
> that the pager exits.

That's weird. I can't reproduce at all here. But I also can't think of a
thing that Git could do that would impact the behavior. For example:

  1. Git should never kill() the pager; in fact it waits for it to
     finish.

  2. Git can impact the pager environment and command line options, but
     those haven't changed anytime recently (and besides, I'm not sure
     there even is an option to convince less to die).

  3. Git can impact the set of blocked signals that the pager sees, but
     I think less would set up its own handler for SIGINT anyway.

I suppose it's possible that your shell or another program (tmux,
maybe?) catches the SIGINT and does a process-group kill. But then I
don't know why it would matter that you're using an alias. The process
tree without an alias:

  |-xterm,21861,peff
  |   `-bash,21863
  |       `-git,22376 log
  |           `-less,22377

and with:

  |-xterm,21861,peff
  |   `-bash,21863
  |       `-git,22391 l
  |           `-git-log,22393
  |               `-less,22394

are pretty similar.

Puzzling.

-Peff

Reply via email to