This repository was archived by the owner on Apr 1, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
packages/opencode/src/cli/cmd/tui/util Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -61,7 +61,7 @@ export namespace Clipboard {
6161 const getCopyMethod = lazy ( ( ) => {
6262 const os = platform ( )
6363
64- if ( os === "darwin" ) {
64+ if ( os === "darwin" && Bun . which ( "oascript" ) ) {
6565 console . log ( "clipboard: using osascript" )
6666 return async ( text : string ) => {
6767 const escaped = text . replace ( / \\ / g, "\\\\" ) . replace ( / " / g, '\\"' )
@@ -70,13 +70,13 @@ export namespace Clipboard {
7070 }
7171
7272 if ( os === "linux" ) {
73- if ( process . env [ "WAYLAND_DISPLAY" ] ) {
73+ if ( process . env [ "WAYLAND_DISPLAY" ] && Bun . which ( "wl-copy" ) ) {
7474 console . log ( "clipboard: using wl-copy" )
7575 return async ( text : string ) => {
7676 const proc = Bun . spawn ( [ "wl-copy" ] , { stdin : "pipe" , stdout : "ignore" , stderr : "ignore" } )
7777 proc . stdin . write ( text )
7878 proc . stdin . end ( )
79- await proc . exited
79+ await proc . exited . catch ( ( ) => { } )
8080 }
8181 }
8282 if ( Bun . which ( "xclip" ) ) {
@@ -117,7 +117,7 @@ export namespace Clipboard {
117117
118118 console . log ( "clipboard: no native support" )
119119 return async ( text : string ) => {
120- await clipboardy . write ( text )
120+ await clipboardy . write ( text ) . catch ( ( ) => { } )
121121 }
122122 } )
123123
You can’t perform that action at this time.
0 commit comments