Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: clear-screen widget and prompt expansion
- X-seq: zsh-workers 38001
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: clear-screen widget and prompt expansion
- Date: Tue, 16 Feb 2016 10:43:51 -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:content-type; bh=Th0r0qeiNgI0TCMQK9YuA++V0NHKQJLhtquW+nky01w=; b=cAbfD4uLqLIrcCg50ZSAy6jty2zLiIFiYSKhYtE6dK9ozUePaTNRBcvQ8E3mnE82CK hBSH2pfqklK3a9qbRFizF/1f0HENZGAcecYAQQlL/th8i5NIeM+9kEX1CQsrDApoTCBg htNgM7FeBTEe/QULrPUHMN3j+sx/PElZtlzbmDUS83WtL8fBq6BiFM1M4J6F40NE/Eiz Im215KK1nQJUfsXKsgp8RKbNBsVRGk3dC/3xzB6OHTTxzaQTRYAXqBnJTjf41YzAayZI 5+eQPDzuAlM3D4R0Gt7tFTSnoqXfJi/jjzWRqW/tb7IkriFWa8EH/T6giZFePucjEYKc Am9w==
- In-reply-to: <20160216100140.GA27569@cventin.lip.ens-lyon.fr>
- 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: <20160204141206.GA9349@cventin.lip.ens-lyon.fr> <160204073731.ZM25972@torch.brasslantern.com> <20160216100140.GA27569@cventin.lip.ens-lyon.fr>
On Feb 16, 11:01am, Vincent Lefevre wrote:
}
} I meant that prompt is already re-expanded when the terminal is
} resized. What I'm saying is that clear-screen is not consistent
} with that.
Ah. Well, clear-screen is a widget and existed in primordial form
long before the shell even knew about SIGWINCH, so it's not very
surprising that it hasn't been overhauled with more recent changes
to prompt handling.
This raises the question of whether redisplay (^R) should also imply
a reset-prompt. However, it explicitly says "the edit buffer" whereas
clear-screen mentions "redraw the prompt".
} zle -A clear-screen real-clear-screen
} cls-rp() { zle real-clear-screen; zle reset-prompt }
} zle -N clear-screen cls-rp
}
} [...] doesn't work in incremental search mode
That's because incremental-search has its own input loop and does not
recognize user-defined widgets. An entirely different problem.
Does the following break anything?
diff --git a/Src/Zle/zle_refresh.c b/Src/Zle/zle_refresh.c
index 3d2471e..7e4f328 100644
--- a/Src/Zle/zle_refresh.c
+++ b/Src/Zle/zle_refresh.c
@@ -2424,6 +2424,7 @@ clearscreen(UNUSED(char **args))
tcoutclear(TCCLEARSCREEN);
resetneeded = 1;
clearflag = 0;
+ reexpandprompt();
return 0;
}
Messages sorted by:
Reverse Date,
Date,
Thread,
Author