Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
RE: [ksh emulation] zle and bindkey commands not available when called from /etc/kshrc
- X-seq: zsh-users 14363
- From: "Tristan TERPELLE" <tristan.terpelle@xxxxxxxxxxxxxxx>
- To: <zsh-users@xxxxxxxxxx>
- Subject: RE: [ksh emulation] zle and bindkey commands not available when called from /etc/kshrc
- Date: Fri, 11 Sep 2009 09:57:39 +0200
- Importance: normal
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- Priority: normal
- Thread-index: AcoytQC4MaQa+tgSQX+8alR9R8HiFAAACkUw
- Thread-topic: RE: [ksh emulation] zle and bindkey commands not available when called from /etc/kshrc
> -----Original Message-----
> From: Peter Stephenson [mailto:pws@xxxxxxx]
> Sent: Thursday 10 September 2009 11:57
> To: zsh-users@xxxxxxxxxx
> Subject: Re: [ksh emulation] zle and bindkey commands not available when called from /etc/kshrc
>
> On Thu, 10 Sep 2009 11:37:24 +0200
> "Tristan TERPELLE" <tristan.terpelle@xxxxxxxxxxxxxxx> wrote:
>> When I use zsh' ksh emulation mode, the following lines in /etc/kshrc
>> result in errors:
>>
>> autoload -Uz edit-command-line
>> zle -N edit-command-line
>> bindkey -M vicmd 'v' edit-command-line
>>
>> The errors are:
>>
>> /etc/kshrc:4: command not found: zle
>> /etc/kshrc:5: command not found: bindkey
>> /etc/kshrc:4: command not found: zle
>> /etc/kshrc:5: command not found: bindkey
>> /etc/kshrc:4: command not found: zle
>> /etc/kshrc:5: command not found: bindkey
>
> When it starts up in ksh emulation, zsh doesn't arrange to load modules
> with its own extensions automatically when they are accessed by command
> names, so that the names of the builtins don't clash. It's probably worth
> pointing out that zsh isn't really designed to do it's own clever
> extensions in other emulations---they're there as an alternative, to make
> it easier to use stuff written for other shells. So you're going a bit
> beyond the design criteria. However, there are usually ways of fixing
> things up.
>
> For an interactive shell you can load the zle module by hand:
>
> zmodload zsh/zle
>
> (if you have an older version of zsh, not a recent 4.3 release, use
> "zmodload -i zsh/zle" to avoid an error if the module was already loaded).
> This is slightly simpler than the code it's replacing, actually, which
> would mark the command zle and bindkey for autoloading---however, if you're
> about to call the commands anyway, that's pointless.
>
> You might encounter similar problems with completion, if you're using
> that, and need to load the modules zsh/complete and zsh/computil. I'm not
> sure how well the completion system is set up to be called from ksh
> emulation.
>
Hi Peter
The zmodload zsh/zle command works beautifully! I've added the following lines
to /etc/kshrc
autoload -Uz edit-command-line
zmodload -i zsh/zle
bindkey -M vicmd 'v' edit-command-line
Thanks for the help!
Regards
Tristan Terpelle
____
This message and any files transmitted with it are legally privileged and intended for the sole use of the individual(s) or entity to whom they are addressed. If you are not the intended recipient, please notify the sender by reply and delete the message and any attachments from your system. Any unauthorised use or disclosure of the content of this message is strictly prohibited and may be unlawful.
Nothing in this e-mail message amounts to a contractual or legal commitment on the part of EUROCONTROL, unless it is confirmed by appropriately signed hard copy.
Any views expressed in this message are those of the sender.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author