mirror of
https://github.com/fankes/termux-app.git
synced 2025-09-04 17:55:36 +08:00
Add PASTE
extra key for pasting text from clipboard
This commit is contained in:
@@ -1980,7 +1980,7 @@ public final class TerminalEmulator {
|
||||
int startIndex = textParameter.indexOf(";") + 1;
|
||||
try {
|
||||
String clipboardText = new String(Base64.decode(textParameter.substring(startIndex), 0), StandardCharsets.UTF_8);
|
||||
mSession.clipboardText(clipboardText);
|
||||
mSession.onCopyTextToClipboard(clipboardText);
|
||||
} catch (Exception e) {
|
||||
mClient.logError(LOG_TAG, "OSC Manipulate selection, invalid string '" + textParameter + "");
|
||||
}
|
||||
|
@@ -18,8 +18,11 @@ public abstract class TerminalOutput {
|
||||
/** Notify the terminal client that the terminal title has changed. */
|
||||
public abstract void titleChanged(String oldTitle, String newTitle);
|
||||
|
||||
/** Notify the terminal client that the terminal title has changed. */
|
||||
public abstract void clipboardText(String text);
|
||||
/** Notify the terminal client that text should be copied to clipboard. */
|
||||
public abstract void onCopyTextToClipboard(String text);
|
||||
|
||||
/** Notify the terminal client that text should be pasted from clipboard. */
|
||||
public abstract void onPasteTextFromClipboard();
|
||||
|
||||
/** Notify the terminal client that a bell character (ASCII 7, bell, BEL, \a, ^G)) has been received. */
|
||||
public abstract void onBell();
|
||||
|
@@ -269,8 +269,13 @@ public final class TerminalSession extends TerminalOutput {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clipboardText(String text) {
|
||||
mClient.onClipboardText(this, text);
|
||||
public void onCopyTextToClipboard(String text) {
|
||||
mClient.onCopyTextToClipboard(this, text);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPasteTextFromClipboard() {
|
||||
mClient.onPasteTextFromClipboard(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -13,7 +13,9 @@ public interface TerminalSessionClient {
|
||||
|
||||
void onSessionFinished(TerminalSession finishedSession);
|
||||
|
||||
void onClipboardText(TerminalSession session, String text);
|
||||
void onCopyTextToClipboard(TerminalSession session, String text);
|
||||
|
||||
void onPasteTextFromClipboard(TerminalSession session);
|
||||
|
||||
void onBell(TerminalSession session);
|
||||
|
||||
|
@@ -37,10 +37,14 @@ public abstract class TerminalTestCase extends TestCase {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clipboardText(String text) {
|
||||
public void onCopyTextToClipboard(String text) {
|
||||
clipboardPuts.add(text);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPasteTextFromClipboard() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBell() {
|
||||
bellsRung++;
|
||||
|
Reference in New Issue
Block a user