From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-5.8 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by dcvr.yhbt.net (Postfix) with ESMTP id 2A9A120756 for ; Fri, 6 Jan 2017 06:47:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030735AbdAFGrQ (ORCPT ); Fri, 6 Jan 2017 01:47:16 -0500 Received: from cloud.peff.net ([104.130.231.41]:35850 "EHLO cloud.peff.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S939550AbdAFGrQ (ORCPT ); Fri, 6 Jan 2017 01:47:16 -0500 Received: (qmail 22553 invoked by uid 109); 6 Jan 2017 06:40:34 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.84) with SMTP; Fri, 06 Jan 2017 06:40:34 +0000 Received: (qmail 14899 invoked by uid 111); 6 Jan 2017 06:41:25 -0000 Received: from sigill.intra.peff.net (HELO sigill.intra.peff.net) (10.0.0.7) by peff.net (qpsmtpd/0.84) with SMTP; Fri, 06 Jan 2017 01:41:25 -0500 Received: by sigill.intra.peff.net (sSMTP sendmail emulation); Fri, 06 Jan 2017 01:40:32 -0500 Date: Fri, 6 Jan 2017 01:40:32 -0500 From: Jeff King To: Trygve Aaberge Cc: git@vger.kernel.org Subject: Re: Regression: Ctrl-c from the pager in an alias exits it Message-ID: <20170106064032.eqxxer5mx5hsh2md@sigill.intra.peff.net> References: <20170105142529.GA15009@aaberge.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20170105142529.GA15009@aaberge.net> Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org 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