Feature #1823

Readline Command Completion

Added by scrapcoder (Bryan Richardson) almost 3 years ago. Updated 20 days ago.

[ruby-core:24581]
Status:Rejected Start date:07/28/2009
Priority:Normal Due date:
Assignee:kouji (Kouji Takao) % Done:

0%

Category:ext
Target version:2.0.0

Description

Readline lets you specify a character to append to the end of the string after command completion has succeeded (i.e. a space after a matched command or a '/' after a matched directory).  In the command completion proc, I'm providing an array comprised of available commands in the application as well as a list of possible directories given the string provided (i.e. Dir[str + '*']).  Thus, depending on what the string is determined to be (a command, a directory, or a file), I'd like to assign either a space or a '/' as the append character.

The easiest way I see to do this is to be able to provide a proc to the Readline.completion_append_character variable rather than a string, and have the completed command string passed to the proc.  This way, one can determine if the string is a command, a directory, or a file and return the appropriate append string.  I would provide a patch, but I'm not a solid enough C coder to even attempt this... sorry!

Related issues

related to Backport93 - Backport #4635: Readline.completion_append_character Closed

History

Updated by marcandre (Marc-Andre Lafortune) over 2 years ago

  • Category changed from build to lib
  • Assignee set to kouji (Kouji Takao)

Updated by znz (Kazuhiro NISHIYAMA) about 2 years ago

  • Category set to ext
  • Status changed from Open to Assigned
  • Target version set to 2.0.0

Updated by mame (Yusuke Endoh) 3 months ago

Takao-san, any update here? -- Yusuke Endoh <mame@tsg.ne.jp>

Updated by kouji (Kouji Takao) 20 days ago

  • Status changed from Assigned to Rejected
Sorry, late reply. I'm going to implement Readline.pre_input_hook, Readline.insert_text and Readline.redisplay. These are wrapper for rl_pre_input_hook, rl_insert_text and rl_redisplay. So I think you will be able to implement a proc which you want. So, I closed this issue. Thanks.

Also available in: Atom PDF