-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed: Parse (but ignore for now) terminal APC sequences
- Loading branch information
Showing
2 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
terminal-emulator/src/test/java/com/termux/terminal/ApcTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.termux.terminal; | ||
|
||
public class ApcTest extends TerminalTestCase { | ||
|
||
public void testApcConsumed() { | ||
// At time of writing this is part of what yazi sends for probing for kitty graphics protocol support: | ||
// https://github.com/sxyazi/yazi/blob/0cdaff98d0b3723caff63eebf1974e7907a43a2c/yazi-adapter/src/emulator.rs#L129 | ||
// This should not result in anything being written to the screen: If kitty graphics protocol support | ||
// is implemented it should instead result in an error code on stdin, and if not it should be consumed | ||
// silently just as xterm does. See https://sw.kovidgoyal.net/kitty/graphics-protocol/. | ||
withTerminalSized(2, 2) | ||
.enterString("\033_Gi=31,s=1,v=1,a=q,t=d,f=24;AAAA\033\\") | ||
.assertLinesAre(" ", " "); | ||
|
||
// It is ok for the APC content to be non printable characters: | ||
withTerminalSized(12, 2) | ||
.enterString("hello \033_some\023\033_\\apc#end\033\\ world") | ||
.assertLinesAre("hello world", " "); | ||
} | ||
|
||
} |