42

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?

4

3 に答える 3

55

いくつかのクリア ショートカットが定義されています。

  • Meta-D: 次の単語をクリアする1
  • Ctrl-K: 行末までクリア
  • Ctrl-U: 行全体をクリア
  • Ctrl-L: 行と画面をクリアします

マニュアルのoctave コマンドライン編集セクションにあるその他の例を参照してください。

歴史的な理由からCtrl-U、通常は ではなく端末によって制御されますがoctave、これoctaveもサポートしています。stty kill undefこれは(で復元)でテストできますstty kill '^U'

1 は多くの場合、キーまたはキーMetaにバインドされます。そうでない場合は、最初に Esc キーを押してから、「メタ化」する必要がある文字を押します。WinAlt

于 2012-06-30T01:20:28.153 に答える
10

Ctrl-A: 行頭に移動します。

Ctrl-K: カーソル位置から始まるすべての文字を削除します。

于 2012-06-29T22:34:16.210 に答える