Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > gnu.bash.bug > #14682 > unrolled thread
| Started by | Eric Pruitt <eric.pruitt@gmail.com> |
|---|---|
| First post | 2018-10-03 00:14 -0700 |
| Last post | 2018-10-03 00:14 -0700 |
| Articles | 1 — 1 participant |
Back to article view | Back to gnu.bash.bug
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
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
| From | Eric Pruitt <eric.pruitt@gmail.com> |
|---|---|
| Date | 2018-10-03 00:14 -0700 |
| Subject | Re: Option to disable VSUSP at prompt (feature request with proof of concept) |
| Message-ID | <mailman.1664.1538550858.1284.bug-bash@gnu.org> |
[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 top | Article view | gnu.bash.bug
csiph-web