mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-12 02:42:56 +02:00
A new action copy_ansi_to_clipboard to copy the current selection with ANSI formatting codes
Fixes #4665
This commit is contained in:
@@ -530,6 +530,28 @@ class TestScreen(BaseTest):
|
||||
s.scroll(2, True)
|
||||
self.ae(s.text_for_selection(), expected)
|
||||
s.reset()
|
||||
s.draw('ab cd')
|
||||
s.start_selection(0, 0)
|
||||
s.update_selection(1, 3)
|
||||
self.ae(s.text_for_selection(), ('ab ', 'cd'))
|
||||
self.ae(s.text_for_selection(False, True), ('ab', 'cd'))
|
||||
s.reset()
|
||||
s.draw('ab cd')
|
||||
s.start_selection(0, 0)
|
||||
s.update_selection(3, 4)
|
||||
self.ae(s.text_for_selection(), ('ab ', ' ', 'cd'))
|
||||
self.ae(s.text_for_selection(False, True), ('ab', '\n', 'cd'))
|
||||
s.reset()
|
||||
s.draw('a')
|
||||
s.select_graphic_rendition(32)
|
||||
s.draw('b')
|
||||
s.select_graphic_rendition(39)
|
||||
s.draw('c xy')
|
||||
s.start_selection(0, 0)
|
||||
s.update_selection(1, 3)
|
||||
self.ae(s.text_for_selection(), ('abc ', 'xy'))
|
||||
self.ae(s.text_for_selection(True), ('a\x1b[32mb\x1b[39mc ', 'xy', '\x1b[m'))
|
||||
self.ae(s.text_for_selection(True, True), ('a\x1b[32mb\x1b[39mc', 'xy', '\x1b[m'))
|
||||
|
||||
def test_soft_hyphen(self):
|
||||
s = self.create_screen()
|
||||
|
||||
Reference in New Issue
Block a user