Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Signal handlers and Re: Behaviour of zle list-choices
- X-seq: zsh-workers 38048
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx, Joe M <joe9mail@xxxxxxxxx>
- Subject: Signal handlers and Re: Behaviour of zle list-choices
- Date: Mon, 29 Feb 2016 10:47:24 -0800
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=onw2TNow33rgodzugan4yAsQLlgl8RmUXiZulmgWtrc=; b=AgfvjGds1p4PLu0HdHlT/n5swzx3PDJm8Yw/7tMaxbnPcfleLvuelZALK5l1MRIQhU XNTuCgbjkD+Qm/WMS69VJKYdbLXnhVzKdEA6N2Y1mh7RAsEmeXd66jyPovSEBNblzn2k pbid2EczbbIv5E4Ufez86pS1I2qMu574vvP4A4ExlJwBYMrw/BGXf1ZuWhJcF1LgBDmr hOCOH19BlDaT+IxAQbb9wlNbSkaACyWKNP5Wi8XCjZ6FkyUseG3clvaubfO3yo8Q5d93 ViL5j26H82cV3fhuwdxh9qC2rFEKMOOy7TRxop8bhchsfcCaVUVYSBSGMQC6CSG7yCKK p0Og==
- In-reply-to: <20160228135652.GB2953@master>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CAHjjW16S5=2=qQrRhZUtgFOC5GUW28SnMHcqa=yCDk7Mdap2eA@mail.gmail.com> <56CFC947.1080507@gmx.com> <20160228134000.GA2953@master> <20160228135652.GB2953@master>
On Feb 28, 7:56am, Joe M wrote:
}
} > type -a -f TRAPINT
} > TRAPINT () {
} > ft_zle_state[minibuffer]=no
} > ft-psvx-default
} > zle reset-prompt 2> /dev/null
} > return 127
} > }
}
} Thanks for your suggestion. Removing the above TRAPINT fixed the
} issue that I am noticing.
OK, that helps. The problem is with calling reset-prompt (really,
with calling redisplay, which is implied by reset-prompt) from the
signal handler. The change to resetneeded and clearflag during the
handler causes ZLE to attempt twice to erase the list and move the
cursor back to the start of the prompt, which ends up moving too far
(though only erasing the list once, oddly enough). It's as though
ZLE gets confused about the state of ALWAYS_LAST_PROMPT.
The following appears to fix it, though I only vaguely understand why.
Anyone care to shed some additional light before this gets committed?
diff --git a/Src/Zle/zle_refresh.c b/Src/Zle/zle_refresh.c
index 7e4f328..aca676a 100644
--- a/Src/Zle/zle_refresh.c
+++ b/Src/Zle/zle_refresh.c
@@ -2435,8 +2435,8 @@ redisplay(UNUSED(char **args))
moveto(0, 0);
zputc(&zr_cr); /* extra care */
tc_upcurs(lprompth - 1);
- resetneeded = 1;
- clearflag = 0;
+ resetneeded = !showinglist;
+ clearflag = showinglist;
return 0;
}
Messages sorted by:
Reverse Date,
Date,
Thread,
Author