シェル階層のCTRL C動作

シェル階層のCTRL C動作

bashのようにシェルを開きますsbtnode debug次に、このシェル内で別のシェルを開きます(それぞれscalaまたは使用node repl)。最後のシェルを閉じて最初に開いたシェル(例:)に戻りたいのですが、+を使用するとsbtすべてのシェル階層が閉じて元のbash端末に戻ります。CTRLC

私が知る限りここ、この種の行動は標準ではなく、私にはお勧めできません。

編集する: 私はこれを理解しようとしているので、実際に問題はnode debugandとは関係ありません。私は私のbashの一般的な非標準動作を示す実験を実行しました。 Windowsで同様の問題が見つかりました。sbtscalaここしかし、私はUbuntu 14.04を使用しています

ベストアンサー1

コマンドを入力すると、exitのネストがquit終了します。次のようにこれらのコマンドを省略することもできます。consolesbt

scala> :q
Not interrupting system thread Thread[process reaper,10,system]

[success] Total time: 138 s, completed May 25, 2014 1:33:22 PM
> 

または、:eこの情報はヘルプページに含まれていますconsole

scala> :help
All commands can be abbreviated, e.g. :he instead of :help.
Those marked with a * have more detailed help, e.g. :help imports.

:cp <path>                 add a jar or directory to the classpath
:help [command]            print this summary or command-specific help
:history [num]             show the history (optional num is commands to show)
:h? <string>               search the history
:imports [name name ...]   show import history, identifying sources of names
:implicits [-v]            show the implicits in scope
:javap <path|class>        disassemble a file or class name
:load <path>               load and interpret a Scala file
:paste                     enter paste mode: all input up to ctrl-D compiled together
:power                     enable power user mode
:quit                      exit the interpreter
:replay                    reset execution and replay all previous commands
:reset                     reset the repl to its initial state, forgetting all session entries
:sh <command line>         run a shell command (result is implicitly => List[String])
:silent                    disable/enable automatic printing of results
:type [-v] <expr>          display the type of an expression without evaluating it
:warnings                  show the suppressed warnings from the most recent line which had any

scala> 

コンソールのキーボードショートカット?

あなたが本当に望むのは、使用できるキーボードショートカット(存在する場合)を見つけることですconsole。この目的のために、この記事では利用可能なものがほとんどないことを示しているようです。

スカラーインタプリタのショートカットキーは、ctl+a、ctl+e、ctl+f、ctl+bのみをサポートし、コードのオートコンプリート(例:f#)だけでなく、タブキーもサポートされていません。

源泉: トピック:スカラーインタプリタコンソールキーボードショートカットとコードオートコンプリート? - メッセージ#00309

REPLはどうですか?

このSO Q&Aのタイトルによると:ScalaのREPLで順方向削除にctrl-dを使用する方法はありますか?Scala 2.9 REPLでは、主キーバインディングを使用できます:keybindings

次のように、カスタムキーバインディングでキーバインディングを上書きすることもできます。

$ scala -Djline.keybindings=/path/to/keybindings.properties

詳細については、上記のSO Q&Aを参照してください。

おすすめ記事