简体   繁体   中英

unable to use arrow keys for previous command in interative commandline app

I have developed an application which has an interactive terminal to accept commands from user. But when i press arrow key in Linux, it fails to show previous command on interactive terminal of my application. However Ubuntu terminal shows previous commands using UP arrow key. In windows command interpreter, i am able to select previous commands using UP arrow key inside my interactive terminal app. Any settings need to be changed in Ubuntu to make it work?

Implementing an interactive terminal is actually not a trivial task. Your application need to send and receive specific code depending on which terminal or terminal emulation is used (ANSI, VT-100, ...)

There are several libraries that can help you implement a portable terminal with history, line editing and more:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM