diff --git a/pkg/gui/controllers/helpers/confirmation_helper.go b/pkg/gui/controllers/helpers/confirmation_helper.go index 25f05906b..8b5919c3c 100644 --- a/pkg/gui/controllers/helpers/confirmation_helper.go +++ b/pkg/gui/controllers/helpers/confirmation_helper.go @@ -259,11 +259,7 @@ func underlineLinks(text string) string { } else { linkEnd += linkStart } - underlinedLink := style.AttrUnderline.Sprint(remaining[linkStart:linkEnd]) - if strings.HasSuffix(underlinedLink, "\x1b[0m") { - // Replace the "all styles off" code with "underline off" code - underlinedLink = underlinedLink[:len(underlinedLink)-2] + "24m" - } + underlinedLink := style.PrintSimpleHyperlink(remaining[linkStart:linkEnd]) result += remaining[:linkStart] + underlinedLink remaining = remaining[linkEnd:] } diff --git a/pkg/gui/controllers/helpers/confirmation_helper_test.go b/pkg/gui/controllers/helpers/confirmation_helper_test.go index 488c72710..76f4329fd 100644 --- a/pkg/gui/controllers/helpers/confirmation_helper_test.go +++ b/pkg/gui/controllers/helpers/confirmation_helper_test.go @@ -27,27 +27,27 @@ func Test_underlineLinks(t *testing.T) { { name: "entire string is a link", text: "https://example.com", - expectedResult: "\x1b[4mhttps://example.com\x1b[24m", + expectedResult: "\x1b]8;;https://example.com\x1b\\https://example.com\x1b]8;;\x1b\\", }, { name: "link preceeded and followed by text", text: "bla https://example.com xyz", - expectedResult: "bla \x1b[4mhttps://example.com\x1b[24m xyz", + expectedResult: "bla \x1b]8;;https://example.com\x1b\\https://example.com\x1b]8;;\x1b\\ xyz", }, { name: "more than one link", text: "bla https://link1 blubb https://link2 xyz", - expectedResult: "bla \x1b[4mhttps://link1\x1b[24m blubb \x1b[4mhttps://link2\x1b[24m xyz", + expectedResult: "bla \x1b]8;;https://link1\x1b\\https://link1\x1b]8;;\x1b\\ blubb \x1b]8;;https://link2\x1b\\https://link2\x1b]8;;\x1b\\ xyz", }, { name: "link in angle brackets", text: "See for details", - expectedResult: "See <\x1b[4mhttps://example.com\x1b[24m> for details", + expectedResult: "See <\x1b]8;;https://example.com\x1b\\https://example.com\x1b]8;;\x1b\\> for details", }, { name: "link followed by newline", text: "URL: https://example.com\nNext line", - expectedResult: "URL: \x1b[4mhttps://example.com\x1b[24m\nNext line", + expectedResult: "URL: \x1b]8;;https://example.com\x1b\\https://example.com\x1b]8;;\x1b\\\nNext line", }, } diff --git a/pkg/gui/global_handlers.go b/pkg/gui/global_handlers.go index e75dfb8f5..9721b4b2a 100644 --- a/pkg/gui/global_handlers.go +++ b/pkg/gui/global_handlers.go @@ -109,14 +109,6 @@ func (gui *Gui) scrollDownConfirmationPanel() error { return nil } -func (gui *Gui) handleConfirmationClick() error { - if gui.Views.Confirmation.Editable { - return nil - } - - return gui.handleGenericClick(gui.Views.Confirmation) -} - func (gui *Gui) handleCopySelectedSideContextItemToClipboard() error { return gui.handleCopySelectedSideContextItemToClipboardWithTruncation(-1) } diff --git a/pkg/gui/keybindings.go b/pkg/gui/keybindings.go index 357c752aa..a3da57659 100644 --- a/pkg/gui/keybindings.go +++ b/pkg/gui/keybindings.go @@ -248,12 +248,6 @@ func (self *Gui) GetInitialKeybindings() ([]*types.Binding, []*gocui.ViewMouseBi Modifier: gocui.ModNone, Handler: self.scrollDownConfirmationPanel, }, - { - ViewName: "confirmation", - Key: gocui.MouseLeft, - Modifier: gocui.ModNone, - Handler: self.handleConfirmationClick, - }, { ViewName: "confirmation", Key: gocui.MouseWheelUp,