The problem is that after the first <Tab> Curses::UI gives control of the terminal to Term::Complete. It acts directly on the terminal, and Curses::UI is not aware of what it does. It is not another perlio layer. Curses::UI is not aware of any keystrokes whilst in Term::Complete::Complete(). From the POD of Term::Complete:
The tty driver is put into raw mode and restored using an operating system specific command, in UNIX-like environments "stty".
So, Curses::UI and Term::Complete are not aware of each other. Term::Complete doesn't define up/down keys. It is tricky to integrate both...
With the snippet as provided, <Tab> must be pressed before attempting a completion; then you type the chars of a word you intend to complete. Subseqent <Tab> presses advance the completion until it is unambiguous. Then you press <Return> - completion done. Refresh the screen with ^L.
In reply to Re^4: word auto-corrector in Curses::UI
by shmem
in thread word auto-corrector in Curses::UI
by Bpl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |