From fc92a27cb26ebfcf6cf79d6cf2c64e99acf84e9c Mon Sep 17 00:00:00 2001 From: Fredrik Fornwall Date: Tue, 28 Feb 2017 00:42:36 +0100 Subject: [PATCH] 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 means "insert the buffer content and send a newline", while a single means just "insert the buffer content". Fixes #261. --- app/src/main/java/com/termux/app/TermuxActivity.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/termux/app/TermuxActivity.java b/app/src/main/java/com/termux/app/TermuxActivity.java index 795cf038..c2a15996 100644 --- a/app/src/main/java/com/termux/app/TermuxActivity.java +++ b/app/src/main/java/com/termux/app/TermuxActivity.java @@ -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); }