English 中文(简体)
阅读ZSH
原标题:Read string with ZSH completions
  • 时间:2011-08-13 17:30:06
  •  标签:
  • shell
  • zsh

我想读到一个用户的插图(使用read内或类似内容),所有填表都能够正常使用。 换言之,我想ZSH要完成所有指挥,但是,在要求ENTER之后,我不想让ZSH执行指挥,而是把护卫放在我的手稿上。 我如何能够做到这一点?

最佳回答

http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#index-vared” rel=“noreferer”>>。

foo= default text 
vared foo

Completion will work as if you were in the value part of a parameter assignment (because that s what vared does). If you want completion like a normal command line, I think you need to fiddle with _complete to make it forget about being inside vared.

zmodload zsh/parameter
autoload +X _complete
functions[_original_complete]=$functions[_complete]
_complete () {
  unset  compstate[vared] 
  _original_complete "$@"
}
foo= default text 
vared foo
问题回答

暂无回答




相关问题
KornShell- Creating a fixed width text file

I need to create a simple fixed width text file in KornShell (ksh). My current attempt using printf to pad the string isn t working out very well. What s the shortest, cleanest way to create a fixed ...

unix find command

how to use the find command to find files/directories which are not matching the pattern. for eg: find <some options > -name "dontfile.txt" should give me output of all the find whose file ...

encoding of file shell script

How can I check the file encoding in a shell script? I need to know if a file is encoded in utf-8 or iso-8859-1. Thanks

Case insensitive comparison of strings in shell script

The == operator is used to compare two strings in shell script. However, I want to compare two strings ignoring case, how can it be done? Is there any standard command for this?

1. 露台式照像

在Windows XP中,没有一时出现指挥时,是否有办法操作一种灰色文字? 我常常需要把“善待”(工作)与“灰色”同起来,即使我的文字没有产出,......

热门标签