Skip to content

Commit 8f2114e

Browse files
author
Taranveer Bains
committed
chore: fix breaking build related to copying characters
1 parent d302fbe commit 8f2114e

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

components/text-selector.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
tea "github.com/charmbracelet/bubbletea"
99
"github.com/charmbracelet/lipgloss"
1010
"github.com/tearingItUp786/chatgpt-tui/util"
11-
"golang.design/x/clipboard"
11+
"github.com/atotto/clipboard"
1212
)
1313

1414
const (
@@ -272,7 +272,7 @@ func (s TextSelector) copySelectedLinesToClipboard() {
272272
}
273273

274274
linesToCopy := util.StripAnsiCodes(strings.Join(selectedLines, "\n"))
275-
clipboard.Write(clipboard.FmtText, []byte(linesToCopy))
275+
clipboard.WriteAll(linesToCopy)
276276
}
277277

278278
func filterLine(line string) string {
@@ -282,10 +282,6 @@ func filterLine(line string) string {
282282
}
283283

284284
func NewTextSelector(w, h int, scrollPos int, sessionData string, colors util.SchemeColors) TextSelector {
285-
err := clipboard.Init()
286-
if err != nil {
287-
panic(err)
288-
}
289285

290286
lines := strings.Split(sessionData, "\n")
291287

0 commit comments

Comments
 (0)