简体   繁体   中英

How to clear the command line in Octave?

In Octave, when typing command in the command line, sometimes I need to erase the whole line and restart a new command. In Matlab, erasing the text would be done with the ESC key. In Octave this does not work. The only way I found to discard the input text is using Ctrl-C . This works, but it is ugly, as it leaves remains on the screen.

Is there a key combination to clear the line in Octave?

清除命令窗口类型

clc

There are several clearing shortcuts defined:

  • Meta-D : clear the next word 1
  • Ctrl-K : clear to the end of the line
  • Ctrl-U : clear the whole line
  • Ctrl-L : clear the line and the screen

See more examples in the octave command-line-editing section of the manual.

For historical reasons Ctrl-U is usually controlled by your terminal rather than octave , although octave also supports it. You can test this with stty kill undef (restore with stty kill '^U' ).

1 Meta is often bound to the Win key or the Alt key. If not hit the Esc key first and then the character that needs to be "metaified".

Ctrl-A : go to beginning of line.

Ctrl-K : kill all characters starting at the cursor.

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