Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: How can one get editable, completing *and* history retrieval read command?
- X-seq: zsh-users 13216
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: How can one get editable, completing *and* history retrieval read command?
- Date: Thu, 11 Sep 2008 07:44:37 -0700
- In-reply-to: <6cd6de210809110442w191b1444k724c621b7ec3b33d@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <6cd6de210809110442w191b1444k724c621b7ec3b33d@xxxxxxxxxxxxxx>
On Sep 11, 7:42am, Rocky Bernstein wrote:
}
} I see there is both "vared" and "read" and "vared" would work if it
} handled history retrieval like an interactive prompt does. Also,
} I would need a way to determine if a given file descriptor is
} interactive or not. (This last aspect I have a feeling I can figure
} out some way, although perhaps not the best way).
I think you want "vared -h ..." ?
If the -p flag is given, the following string will be taken as the
prompt to display at the left. If the -r flag is given, the
following string gives the prompt to display at the right. If the
-h flag is specified, the history can be accessed from ZLE. If the
-e flag is given, typing ^D (Control-D) on an empty line causes
vared to exit immediately with a non-zero return value.
You can combine this with "fc -p"/"fc -P" to use a different history in
vared. See Functions/Misc/sticky-note for an example.
As for whether a descriptor is "interactive", probably the closest you
can get is "[[ -t 0 ]]" (replace 0 with the fd you're interested in).
Messages sorted by:
Reverse Date,
Date,
Thread,
Author