JShell 快捷方式,用于行首和行尾

JShell short-cut for going at the start of line and going at the end of line

在行首和行尾移动光标有什么快捷方式吗?我们可以使用任何快捷方式而不是左右移动箭头吗?

这个来自 documentation:

The editing capabilities of JShell are similar to that of other common shells. Keyboard keys and key combinations provide line editing shortcuts. The Ctrl key and Meta key are used in key combinations. If your keyboard doesn’t have a Meta key, then the Alt key is often mapped to provide Meta key functionality.

您可以使用:

Ctrl+A

将光标移动到行首

Ctrl+E

将光标移动到行尾。