mirror of
https://github.com/nix-community/nix-on-droid-app.git
synced 2025-12-07 09:31:11 +01: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:
parent
29e62e608f
commit
fc92a27cb2
1 changed files with 3 additions and 1 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue