terminal code eaters: implement OSC
This is a useful piece of functionality to being able to eat URL hyperlinks, for instance, which is a bug that Lix has while dealing with terminal output today. Change-Id: I77b2de107b2525cad7ea5dea28bfba2cc78b9e6d
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
from functional2.testlib.terminal_code_eater import eat_terminal_codes
|
||||
|
||||
|
||||
def test_eats_color():
|
||||
assert eat_terminal_codes(b'\x1b[7mfoo blah bar\x1b[0m') == b'foo blah bar'
|
||||
|
||||
def test_eats_osc():
|
||||
assert eat_terminal_codes(b'\x1b]8;;http://example.com\x1b\\This is a link\x1b]8;;\x1b\\') == b'This is a link'
|
||||
Reference in New Issue
Block a user