mirror of
https://github.com/fankes/termux-app.git
synced 2025-09-09 03:54:17 +08:00
Support clicking directly on a URL to open it
This allows you to click/press directly on a URL in the terminal view to open it. It takes priority over opening the keyboard, so if you click on a URL it is opened, and if you click anywhere else the keyboard opens like before. Currently, if the application in the terminal is tracking the mouse and you click on a URL, both actions happen. The mouse event is sent to the application, and the URL is also opened. To enable support for this, you have to set `terminal-onclick-url-open=true` in `termux.properties`.
This commit is contained in:
@@ -45,4 +45,21 @@ public class ScreenBufferTest extends TerminalTestCase {
|
||||
withTerminalSized(5, 3).enterString("ABC\r\nFG");
|
||||
assertEquals("ABC\nFG", mTerminal.getScreen().getSelectedText(0, 0, 1, 1, true, true));
|
||||
}
|
||||
|
||||
public void testGetWordAtLocation() {
|
||||
withTerminalSized(5, 3).enterString("ABCDEFGHIJ\r\nKLMNO");
|
||||
assertEquals("ABCDEFGHIJKLMNO", mTerminal.getScreen().getWordAtLocation(0, 0));
|
||||
assertEquals("ABCDEFGHIJKLMNO", mTerminal.getScreen().getWordAtLocation(4, 1));
|
||||
assertEquals("ABCDEFGHIJKLMNO", mTerminal.getScreen().getWordAtLocation(4, 2));
|
||||
|
||||
withTerminalSized(5, 3).enterString("ABC DEF GHI ");
|
||||
assertEquals("ABC", mTerminal.getScreen().getWordAtLocation(0, 0));
|
||||
assertEquals("", mTerminal.getScreen().getWordAtLocation(3, 0));
|
||||
assertEquals("DEF", mTerminal.getScreen().getWordAtLocation(4, 0));
|
||||
assertEquals("DEF", mTerminal.getScreen().getWordAtLocation(0, 1));
|
||||
assertEquals("DEF", mTerminal.getScreen().getWordAtLocation(1, 1));
|
||||
assertEquals("GHI", mTerminal.getScreen().getWordAtLocation(0, 2));
|
||||
assertEquals("", mTerminal.getScreen().getWordAtLocation(1, 2));
|
||||
assertEquals("", mTerminal.getScreen().getWordAtLocation(2, 2));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user