mirror of
https://github.com/fankes/termux-app.git
synced 2025-09-05 02:05:25 +08:00
Extended keyboard: allow inline input
Ff the buffer is empty, send a newline, otherwise send the content of the buffer with the newline stripped. This way <Enter><Enter> means "insert the buffer content and send a newline", while a single <Enter> means just "insert the buffer content". Fixes #261.
This commit is contained in:
@@ -250,7 +250,9 @@ public final class TermuxActivity extends Activity implements ServiceConnection
|
||||
TerminalSession session = getCurrentTermSession();
|
||||
if (session != null) {
|
||||
if (session.isRunning()) {
|
||||
session.write(editText.getText().toString() + "\n");
|
||||
String textToSend = editText.getText().toString();
|
||||
if (textToSend.length() == 0) textToSend = "\n";
|
||||
session.write(textToSend);
|
||||
} else {
|
||||
removeFinishedSession(session);
|
||||
}
|
||||
|
Reference in New Issue
Block a user