screen-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Insert date


From: Stephane Chazelas
Subject: Re: Insert date
Date: Thu, 21 Apr 2005 20:36:46 +0100
User-agent: Mutt/1.5.6i

On Thu, Apr 21, 2005 at 08:38:34PM +0200, Julius Plenz wrote:
> Recently, I came across the idea to bind a key to insert the current
> date, just like I bound keys to insert things using "stuff".
> 
> However, I tried :bind d exec ! date +%Y-%m-%d. That almost works like
> expected. I couldn't figure out exactly, but screen adds some strange
> control character before or after the command.
> 
> Why doesn't this work? How do I realize to insert the current date?
[...]

If you want the output of that command to be inserted as if
typed from the keyboard, then, it should be exec .!.
Note that date outputs a trailing NL (^J) character, that may be
what you get.

:bind d exec .!. zsh -c 'print -Pn %D{%F}'

-- 
Stéphane




reply via email to

[Prev in Thread] Current Thread [Next in Thread]