alacritty: `WARN: Unable to store text in clipboard: NSPasteboard#writeObjects: returned false` when selecting with mouse at MacOS

After selecting text with mouse pointer sometimes following warning appears at the bottom of the terminal. Seemingly randomly. Screenshot 2024-06-14 at 14 13 34

System

OS: macOS Sonoma 14.5 (23F79)

Version: Version 0.13.2 (1)

Darwin Kernel Version 23.5.0: Wed May 1 20:13:18 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6030 arm64

Logs

 tail /var/folders/nr/m7858jr50fb0168tb3q2r5bm0000gn/T/Alacritty-952.log
[339667.435185333s] [WARN ] [alacritty] Unable to store text in clipboard: NSPasteboard#writeObjects: returned false
[352628.383404542s] [WARN ] [alacritty] Unable to store text in clipboard: NSPasteboard#writeObjects: returned false
[356527.608468667s] [WARN ] [alacritty] Unable to store text in clipboard: NSPasteboard#writeObjects: returned false
[356532.234269500s] [WARN ] [alacritty] Unable to store text in clipboard: NSPasteboard#writeObjects: returned false
[356721.911161667s] [WARN ] [alacritty] Unable to store text in clipboard: NSPasteboard#writeObjects: returned false
[356727.422414167s] [WARN ] [alacritty] Unable to store text in clipboard: NSPasteboard#writeObjects: returned false
[356730.222663625s] [WARN ] [alacritty] Unable to store text in clipboard: NSPasteboard#writeObjects: returned false
[356741.702737833s] [WARN ] [alacritty] Unable to store text in clipboard: NSPasteboard#writeObjects: returned false
[356748.362576542s] [WARN ] [alacritty] Unable to store text in clipboard: NSPasteboard#writeObjects: returned false
[356773.391047542s] [WARN ] [alacritty] Unable to store text in clipboard: NSPasteboard#writeObjects: returned false

Font/Terminal size:

/alacritty -vv
Created log file at "/var/folders/nr/m7858jr50fb0168tb3q2r5bm0000gn/T/Alacritty-34524.log"
[0.000001500s] [INFO ] [alacritty] Welcome to Alacritty
[0.000131500s] [INFO ] [alacritty] Version 0.13.2 (bb8ea18)
[0.004055542s] [INFO ] [alacritty] Configuration files loaded from:
                                     "/Users/slasch/.config/alacritty/alacritty.toml"
[0.005761959s] [DEBUG] [alacritty] Using environment locale: en_US.UTF-8
2024-06-14 14:16:13.627 alacritty[34524:6054321] WARNING: Secure coding is not enabled for restorable state! Enable secure coding by implementing NSApplicationDelegate.applicationSupportsSecureRestorableState: and returning YES.
[0.021227750s] [INFO ] [alacritty] Using Apple CGL
[0.032199459s] [DEBUG] [alacritty] Picked GL Config:
                                     buffer_type: Some(Rgb { r_size: 8, g_size: 8, b_size: 8 })
                                     alpha_size: 8
                                     num_samples: 0
                                     hardware_accelerated: true
                                     supports_transparency: Some(true)
                                     config_api: Api(OPENGL)
                                     srgb_capable: true
[0.045585584s] [INFO ] [alacritty] Window scale factor: 2
[0.047285709s] [DEBUG] [alacritty] Loading "Fira Code" font
[0.121756292s] [INFO ] [alacritty] Running on Apple M3 Pro
[0.121799500s] [INFO ] [alacritty] OpenGL version 4.1 Metal - 88.1, shader_version 4.10
[0.121808792s] [INFO ] [alacritty] Using OpenGL 3.3 renderer
[0.124647042s] [DEBUG] [alacritty] Filling glyph cache with common glyphs
[0.127835959s] [INFO ] [alacritty] Cell size: 17 x 35
[0.127849625s] [INFO ] [alacritty] Padding: 0 x 0
[0.127856334s] [INFO ] [alacritty] Width: 3024, Height: 1888
[0.174437292s] [INFO ] [alacritty] PTY dimensions: 53 x 177
[0.178122792s] [INFO ] [alacritty] Initialisation complete
[0.244738709s] [DEBUG] [alacritty_terminal] Ignoring unknown mode 1034 in set_private_mode
2024-06-14 14:16:17.344 alacritty[34524:6054321] TSM AdjustCapsLockLEDForKeyTransitionHandling - _ISSetPhysicalKeyboardCapsLockLED Inhibit
[3.745407375s] [INFO ] [alacritty] Goodbye

Keyboard and bindings:

/alacritty --print-events
Created log file at "/var/folders/nr/m7858jr50fb0168tb3q2r5bm0000gn/T/Alacritty-34796.log"
[0.000002167s] [INFO ] [alacritty] Welcome to Alacritty
[0.000228625s] [INFO ] [alacritty] Version 0.13.2 (bb8ea18)
[0.000456459s] [INFO ] [alacritty] Configuration files loaded from:
                                     "/Users/slasch/.config/alacritty/alacritty.toml"
2024-06-14 14:17:57.806 alacritty[34796:6056189] WARNING: Secure coding is not enabled for restorable state! Enable secure coding by implementing NSApplicationDelegate.applicationSupportsSecureRestorableState: and returning YES.
[0.012034334s] [INFO ] [alacritty] winit event: NewEvents(Init)
[0.012086292s] [INFO ] [alacritty] winit event: Resumed
[0.012106000s] [INFO ] [alacritty] Using Apple CGL
[0.037294084s] [INFO ] [alacritty] Window scale factor: 2
[0.063286500s] [INFO ] [alacritty] Running on Apple M3 Pro
[0.063320959s] [INFO ] [alacritty] OpenGL version 4.1 Metal - 88.1, shader_version 4.10
[0.063330750s] [INFO ] [alacritty] Using OpenGL 3.3 renderer
[0.069301084s] [INFO ] [alacritty] Cell size: 17 x 35
[0.069352459s] [INFO ] [alacritty] Padding: 0 x 0
[0.069363917s] [INFO ] [alacritty] Width: 3024, Height: 1888
[0.085926500s] [INFO ] [alacritty] PTY dimensions: 53 x 177
[0.087715542s] [INFO ] [alacritty] Initialisation complete
[0.093340334s] [INFO ] [alacritty] winit event: WindowEvent { window_id: WindowId(WindowId(5455027200)), event: RedrawRequested }
[0.109752959s] [INFO ] [alacritty] winit event: UserEvent(Event { window_id: Some(WindowId(WindowId(5455027200))), payload: Terminal(Wakeup) })
[0.109796542s] [INFO ] [alacritty] winit event: WindowEvent { window_id: WindowId(WindowId(5455027200)), event: Resized(PhysicalSize { width: 1600, height: 1200 }) }
[0.109811834s] [INFO ] [alacritty] winit event: WindowEvent { window_id: WindowId(WindowId(5455027200)), event: Focused(false) }
[0.109819625s] [INFO ] [alacritty] winit event: WindowEvent { window_id: WindowId(WindowId(5455027200)), event: Resized(PhysicalSize { width: 3024, height: 1888 }) }
[0.109826875s] [INFO ] [alacritty] winit event: WindowEvent { window_id: WindowId(WindowId(5455027200)), event: Moved(PhysicalPosition { x: 2004, y: 2956 }) }
[0.109835042s] [INFO ] [alacritty] winit event: WindowEvent { window_id: WindowId(WindowId(5455027200)), event: RedrawRequested }
[0.112139459s] [INFO ] [alacritty] winit event: AboutToWait
[0.112187917s] [INFO ] [alacritty] winit event: NewEvents(WaitCancelled { start: Instant { tv_sec: 357211, tv_nsec: 16094916 }, requested_resume: None })
... <CUT FEW LINES> ...
[1.141976334s] [INFO ] [alacritty] winit event: DeviceEvent { device_id: DeviceId(DeviceId), event: Motion { axis: 1, value: -1.0 } }
[1.142218334s] [INFO ] [alacritty] winit event: DeviceEvent { device_id: DeviceId(DeviceId), event: MouseMotion { delta: (0.0, -1.0) } }
[1.142315375s] [INFO ] [alacritty] winit event: WindowEvent { window_id: WindowId(WindowId(5455027200)), event: CursorMoved { device_id: DeviceId(DeviceId), position: PhysicalPosition { x: 1752.4765625, y: 1079.34375 } } }
[1.142354625s] [INFO ] [alacritty] winit event: AboutToWait
[1.148650709s] [INFO ] [alacritty] winit event: NewEvents(WaitCancelled { start: Instant { tv_sec: 357212, tv_nsec: 46301541 }, requested_resume: None })
[1.149114459s] [INFO ] [alacritty] winit event: DeviceEvent { device_id: DeviceId(DeviceId), event: Motion { axis: 0, value: -1.0 } }
[1.149209750s] [INFO ] [alacritty] winit event: DeviceEvent { device_id: DeviceId(DeviceId), event: MouseMotion { delta: (-1.0, 0.0) } }
[1.149255042s] [INFO ] [alacritty] winit event: WindowEvent { window_id: WindowId(WindowId(5455027200)), event: CursorMoved { device_id: DeviceId(DeviceId), position: PhysicalPosition { x: 1752.015625, y: 1078.8828125 } } }
[1.149295417s] [INFO ] [alacritty] winit event: AboutToWait
[1.180502375s] [INFO ] [alacritty] winit event: NewEvents(WaitCancelled { start: Instant { tv_sec: 357212, tv_nsec: 53240583 }, requested_resume: None })
[1.180728917s] [INFO ] [alacritty] winit event: AboutToWait
[1.363148709s] [INFO ] [alacritty] winit event: NewEvents(WaitCancelled { start: Instant { tv_sec: 357212, tv_nsec: 84731833 }, requested_resume: None })
[1.365122750s] [INFO ] [alacritty] winit event: WindowEvent { window_id: WindowId(WindowId(5455027200)), event: KeyboardInput { device_id: DeviceId(DeviceId), event: KeyEvent { physical_key: Code(SuperLeft), logical_key: Named(Super), text: None, location: Left, state: Pressed, repeat: false, platform_specific: KeyEventExtra { text_with_all_modifiers: None, key_without_modifiers: Named(Super) } }, is_synthetic: false } }
[1.365300167s] [INFO ] [alacritty] winit event: WindowEvent { window_id: WindowId(WindowId(5455027200)), event: ModifiersChanged(Modifiers { state: ModifiersState(SUPER), pressed_mods: ModifiersKeys(LSUPER) }) }
[1.365369667s] [INFO ] [alacritty] winit event: AboutToWait
[1.663859084s] [INFO ] [alacritty] winit event: NewEvents(WaitCancelled { start: Instant { tv_sec: 357212, tv_nsec: 269638375 }, requested_resume: None })
2024-06-14 14:17:59.470 alacritty[34796:6056189] TSM AdjustCapsLockLEDForKeyTransitionHandling - _ISSetPhysicalKeyboardCapsLockLED Inhibit
[1.674602875s] [INFO ] [alacritty] winit event: WindowEvent { window_id: WindowId(WindowId(5455027200)), event: KeyboardInput { device_id: DeviceId(DeviceId), event: KeyEvent { physical_key: Code(KeyW), logical_key: Character("w"), text: Some("w"), location: Standard, state: Pressed, repeat: false, platform_specific: KeyEventExtra { text_with_all_modifiers: Some("w"), key_without_modifiers: Character("w") } }, is_synthetic: false } }
[1.674785000s] [INFO ] [alacritty] winit event: AboutToWait
[1.674910875s] [INFO ] [alacritty] winit event: NewEvents(WaitCancelled { start: Instant { tv_sec: 357212, tv_nsec: 578812083 }, requested_resume: None })
[1.674997084s] [INFO ] [alacritty] winit event: UserEvent(Event { window_id: Some(WindowId(WindowId(5455027200))), payload: Terminal(Exit) })
[1.687551584s] [INFO ] [alacritty] winit event: WindowEvent { window_id: WindowId(WindowId(5455027200)), event: Destroyed }
[1.687617417s] [INFO ] [alacritty] winit event: AboutToWait
[1.688208750s] [INFO ] [alacritty] winit event: NewEvents(WaitCancelled { start: Instant { tv_sec: 357212, tv_nsec: 591585041 }, requested_resume: None })
[1.688270125s] [INFO ] [alacritty] winit event: LoopExiting
[1.688310042s] [INFO ] [alacritty] Goodbye
Deleted log file at "/var/folders/nr/m7858jr50fb0168tb3q2r5bm0000gn/T/Alacritty-34796.log"

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Reactions: 2
  • Comments: 17 (5 by maintainers)

Most upvoted comments

thanks a lot @richardkmichael for your analysis. I reviewed my tmux config and I was using pbcopy as well.

I deleted the following line from my tmux config now:

bind-key -T copy-mode MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "pbcopy"

I’ll observe if this will fix the issue and report here

@slavaschmidt Thanks for mentioning this issue.

I reviewed my tmux copy config, and I’m still using antiquated copy-pipe-and-cancel pbcopy. Since Alacritty supports OSC 52, I should modernize and change tmux to set-clipboard.

I’m unfamiliar with the details of Alacritty/tmux interaction, but am now wondering why Alacritty was involved (and throwing this error) whatsoever. The copy is entirely within tmux, which writes to pbcopy itself.

I guess since tmux set-clipboard defaults to external (which is indeed set for me), it is writing the copied data into Alacritty’s clipboard and then Alacritty wants to write to the system clipboard – which tmux is also doing via pbcopy, at nearly the very same time, so maybe a race-condition on the system clipboard? I’ll report if the error occurs again after I change to OSC 52.

Although I don’t use it, I quick looked at tmux-yank, and it appears to use pbcopy FWIW. The plugin seems unnecessary now, and I’d guess tmux-yank exists from when tmux to clipboard was more complicated (also needing reattach to user namespace).

Unfortunately after few days of silence the issue appeared again. Currently it happens very seldom.

Would be useful to bisect the actual commit that broke this. It shouldn’t be too hard if the lower limit is 0.13.1.

It seems that Homebrew doesn’t retain logs of previously installed packages and it seems my Homebrew has cleared out its pkg cache as well so I don’t know exactly what version < 0.13.2 was installed.

Curiously, I haven’t seen it occur today at all and my computer’s been off for a few days so no other config or OS changes - if/when it reappears, I’ll try with 0.13.1.

Reflecting what @slavaschmidt has said though, I’ve never seen it prior to my most recent brew upgrade so for me it started with 0.13.2.

I’m pretty sure the issue only appears in 0.14.0 dev and 0.13.2, can’t remember seeing it in 0.13.1.

I can try reinstalling other versions and see if that makes any difference or if you’ve got any other suggestions, let me know.

That would be very helpful. There have been some clipboard changes recently, so if that’s it, it should be an easy fix.

Can you try the latest master?