Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: P modify in history event
- X-seq: zsh-users 24445
- From: Peter Stephenson <p.stephenson@xxxxxxxxxxx>
- To: <zsh-users@xxxxxxx>
- Subject: Re: P modify in history event
- Date: Mon, 18 Nov 2019 09:47:09 +0000
- Cms-type: 201P
- Dkim-filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20191118094711euoutp01376107675582d450e9e89ebda36879d9~YOLegMefj2176121761euoutp01J
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1574070431; bh=JrhBAo8V2JQiD00L55XUNSScqMMtZ1rBiBsUxO3xShs=; h=Subject:From:To:Date:In-Reply-To:References:From; b=T3oLsXBokMfkfqC8lMBDMW8AXMaoQRsFVsHhJaBIeSrqSoNE+NK9W9dq/whuWYR39 YJC4COZlg/Zj2IXpzUrZMPCX1rK3cxNa3sgM+qcxS/O6QVCqFQUMkkoDeYOC6LUhSn dZs/upmiwY/ICvdtAnh6gbX8EG/757gRprLsxbNA=
- In-reply-to: <BEBF5AEC-185E-4887-98D7-4731E1D8F7B0@easesoftware.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CGME20191117184333epcas5p15bc1aa7b0f78182c3d1acc703f55d445@epcas5p1.samsung.com> <BEBF5AEC-185E-4887-98D7-4731E1D8F7B0@easesoftware.com>
On Sun, 2019-11-17 at 12:42 -0600, Perry Smith wrote:
> I’m (slowly) reading through zshexpn and playing with things to
> learn. This does not work:
>
> >
> > pedz@MysticSlate my-play-dir % echo /this/is/a/../../path
> > /this/is/a/../../path
> > pedz@MysticSlate my-play-dir % echo !$:P
> > zsh: illegal modifier: P
> even if the file specified exists
I think it just got missed out of the history modifiers, which are
handled in a different place from the modifiers in the case of glob
qualifiers and vaariables.
pws
diff --git a/Src/hist.c b/Src/hist.c
index fd5606dc3..e47be8e15 100644
--- a/Src/hist.c
+++ b/Src/hist.c
@@ -920,6 +920,16 @@ histsubchar(int c)
case 'u':
sline = casemodify(sline, CASMOD_UPPER);
break;
+ case 'P':
+ if (*sline != '/') {
+ char *here = zgetcwd();
+ if (here[strlen(here)-1] != '/')
+ sline = zhtricat(metafy(here, -1, META_HEAPDUP), "/", sline);
+ else
+ sline = dyncat(here, sline);
+ }
+ sline = xsymlink(sline, 1);
+ break;
default:
herrflush();
zerr("illegal modifier: %c", c);
Messages sorted by:
Reverse Date,
Date,
Thread,
Author