in reply to Re^3: word auto-corrector in Curses::UI
in thread word auto-corrector in Curses::UI
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: word auto-corrector in Curses::UI
by Bpl (Scribe) on Jan 09, 2021 at 13:16 UTC | |
by shmem (Chancellor) on Jan 09, 2021 at 15:10 UTC | |
by Bpl (Scribe) on Jan 10, 2021 at 19:50 UTC |