Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #14682

Re: Option to disable VSUSP at prompt (feature request with proof of concept)

Path csiph.com!xmission!news.snarked.org!news.linkpendium.com!news.linkpendium.com!panix!usenet.stanford.edu!not-for-mail
From Eric Pruitt <eric.pruitt@gmail.com>
Newsgroups gnu.bash.bug
Subject Re: Option to disable VSUSP at prompt (feature request with proof of concept)
Date Wed, 3 Oct 2018 00:14:09 -0700
Lines 110
Approved bug-bash@gnu.org
Message-ID <mailman.1664.1538550858.1284.bug-bash@gnu.org> (permalink)
References <20161124080520.GA27021@sinister.codevat.com>
NNTP-Posting-Host lists.gnu.org
Mime-Version 1.0
Content-Type multipart/mixed; boundary="muwxfvyb3pjblu5t"
X-Trace usenet.stanford.edu 1538550859 25905 208.118.235.17 (3 Oct 2018 07:14:19 GMT)
X-Complaints-To action@cs.stanford.edu
To bug-bash@gnu.org
Envelope-to bug-bash@gnu.org
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:references:mime-version :content-disposition:in-reply-to:pgp-key:user-agent; bh=HmcRJ6ea74v4k4U7iMXfqzjfUH5nHnbunpWoz0ByGfM=; b=lyU0FltSxPBLEVxufrqTHcM20yfmZaHIn/DfyfDL+bmti9LfwWv75eNsx20yfpQRJQ 6TnIv1AEKYPV888Aysjx5EJtOgEiVW8y7OIaxKnaCqZvLaEACt/k7d4h07UsX3kQHVLY TKD9Wy/xqBN9V98/tOjzCZ0uHjxm9zXf3hLDiddDIaG4oQDnEe4HNoZrn+zZTrA4NZKf HenV+YUebpvem/hfqnK8KDTYU3z8KrMREu9JrcwSlNMmP8FnUqTN8qbWL40LHxEMEtPF cypyZMMFQQnry/0eKMKn64eLMg41zJFQmms9jzu1hwJMpZyfhltt1Wj7a037sNMMM9xU Dc6g==
X-Google-DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:references :mime-version:content-disposition:in-reply-to:pgp-key:user-agent; bh=HmcRJ6ea74v4k4U7iMXfqzjfUH5nHnbunpWoz0ByGfM=; b=oPxBJywmLJIFEyMRdrmTH2Z5jDvPBmr/YfphVIJGgpApX8R4vAklo8kNGk9NDEvK/M xx2HNku+fb2qvXl3d8o6HIrVsQjmTfzFwdVHkDV5kL4mPvy56opH/r1ey1XBttrGQqIF EOinuAxGedUjJnFQMg8bzvAGcru9lgS3h44YRttPI4bSHvmQkyX1EVviE1uCI3KEAWaH 20SLS+0M+S1L88Ce5aj42XdEZCJT+GjIlZJXRrgNXzllYpRq2CAIjDmw7XKcM6Za3hWj FKPEnX12szXB9fJr4C2APFt5FdSIFDE4peSwXmaRxaLwa+7paomvW5ApWj3uF3yPcqG3 P6fA==
X-Gm-Message-State ABuFfog1G22JckI5BnbjeJd3dt3VKQtK/ActnmTIlDK7z3Q1IsCtsHgR xgv2vlWa7StxegAG5qmr+C/3tVnG
X-Google-Smtp-Source ACcGV60hSu2mZWTv5zKZsDlLAZdzcewJ6GJeM9mFNP3P+12Zomi4wZ7x4BbgxiUkyHvIARDu5XyI+A==
X-Received by 2002:a62:4b09:: with SMTP id y9-v6mr155303pfa.93.1538550851651; Wed, 03 Oct 2018 00:14:11 -0700 (PDT)
Content-Disposition inline
In-Reply-To <20161124080520.GA27021@sinister.codevat.com>
PGP-Key https://www.codevat.com/pgp.asc#F8601B5D2511B4C3535232488DDDE2E6053692AB
User-Agent NeoMutt/20170113 (1.7.2)
X-detected-operating-system by eggs.gnu.org: Genre and OS details not recognized.
X-Received-From 2607:f8b0:4864:20::442
X-BeenThere bug-bash@gnu.org
X-Mailman-Version 2.1.21
Precedence list
List-Id Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe <https://lists.gnu.org/mailman/options/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive <http://lists.gnu.org/archive/html/bug-bash/>
List-Post <mailto:bug-bash@gnu.org>
List-Help <mailto:bug-bash-request@gnu.org?subject=help>
List-Subscribe <https://lists.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
Xref csiph.com gnu.bash.bug:14682

Show key headers only | View raw


[Multipart message — attachments visible in raw view] - view raw

On Thu, Nov 24, 2016 at 12:05:20AM -0800, Eric Pruitt wrote:
> In my Bash configuration, I have things setup so Ctrl+Z is no longer
> translated into a signal at the Bash prompt so it can be remapped. Most
> recently, I decided to modify the Bash source to implement this change
> in the interpreter because the stty invocations introduced a perceptible
> amount of lag on a virtualized OpenBSD host I use. I think this feature
> would be a useful default since it usually does not make sense to send
> SIGTSTP to a prompt. Here's an accompanying snippet from my inputrc:
>
>     # Allows Ctrl+Z to be used to bring programs back into the
>     # foreground. The cursor is moved to the beginning of the line
>     # before typing so a specific job can be resumed by typing its
>     # identifier (e.g. a number) then hitting Ctrl+Z. This depends on
>     # Ctrl+Z being a literal sequence i.e. "stty susp undef".
>     "\C-z": "\C-afg \C-m"

This patch had a bug that I recently fixed, and I've attached an updated
version. Under certain conditions, ^Z for SIGTSTP would not be
re-enabled after executing a command. For example, if "cat /dev/zero >
/dev/null" was interrupted by pressing Ctrl+C, pressing Ctrl+Z would not
generate a literal ^Z control character at the next prompt. Some
debugging revealed that I did not fully understand the control flow of
the prompt handling when writing the original patch; control may be
resumed at the top of the "reader_loop" function by way of a long lump
which bypassed the vsusp toggling code. The bug has been fixed by moving
the vsusp toggle logic after the aforementioned long-jump destination.

I'm not requesting that this patch be accepted upstream, just posting an
updated version for anyone that might interested in this feature.

Eric

Back to gnu.bash.bug | Previous | Next | Find similar | Unroll thread


Thread

Re: Option to disable VSUSP at prompt (feature request with proof of concept) Eric Pruitt <eric.pruitt@gmail.com> - 2018-10-03 00:14 -0700

csiph-web