alacritty: Unable to store text in clipboard: Failed to set new owner of XCB selection

For bug reports, the following information can help speed up the process. Please describe the bug that you have found and what you would expect to happen instead.

System

OS: Linux 6.3.3, NixOS, 23.11 (Tapir) Version: 0.12.1 Linux/BSD: X11, KDE Plasma

Logs

[2102.137443332s] [WARN ] [alacritty] Unable to store text in clipboard: Failed to set new owner of XCB selection
[284288.038636561s] [WARN ] [alacritty] Unable to store text in clipboard: Failed to set new owner of XCB selection
[285770.063621788s] [WARN ] [alacritty] Unable to store text in clipboard: Failed to set new owner of XCB selection
[287648.876951743s] [WARN ] [alacritty] Unable to store text in clipboard: Failed to set new owner of XCB selection
[287980.692431447s] [WARN ] [alacritty] Unable to store text in clipboard: Failed to set new owner of XCB selection

Crashes: No crash Font/Terminal size:

alacritty -vv
Created log file at "/run/user/1000/Alacritty-681201.log"
[0.000005096s] [INFO ] [alacritty] Welcome to Alacritty
[0.000106540s] [INFO ] [alacritty] Version 0.12.1
[0.000118449s] [INFO ] [alacritty] Running on X11
[0.007749742s] [INFO ] [alacritty] Configuration files loaded from:
                                     "/home/exec/.config/alacritty/alacritty.yml"
[0.024258608s] [INFO ] [alacritty] Using GLX 1.4
[0.028270498s] [INFO ] [alacritty] Window scale factor: 2
[0.036653399s] [DEBUG] [alacritty] Loading "Noto Sans Mono" font
[0.057236883s] [DEBUG] [crossfont] Loaded Face Face { ft_face: Font Face: Regular, load_flags: NO_BITMAP | TARGET_LIGHT, render_mode: "Lcd", lcd_filter: 1 }
[0.066534776s] [DEBUG] [crossfont] Loaded Face Face { ft_face: Font Face: Bold, load_flags: NO_BITMAP | TARGET_LIGHT, render_mode: "Lcd", lcd_filter: 1 }
[0.075074836s] [DEBUG] [crossfont] Loaded Face Face { ft_face: Font Face: Regular, load_flags: NO_BITMAP | TARGET_LIGHT, render_mode: "Lcd", lcd_filter: 1 }
[0.083850982s] [DEBUG] [crossfont] Loaded Face Face { ft_face: Font Face: Bold, load_flags: NO_BITMAP | TARGET_LIGHT, render_mode: "Lcd", lcd_filter: 1 }
[0.120895884s] [INFO ] [alacritty] Running on NVIDIA GeForce GTX 1650/PCIe/SSE2
[0.120920966s] [INFO ] [alacritty] Using OpenGL 3.3 renderer
[0.184606248s] [DEBUG] [alacritty] Filling glyph cache with common glyphs
[0.189291460s] [INFO ] [alacritty] Cell size: 14 x 30
[0.189309354s] [INFO ] [alacritty] Padding: 0 x 0
[0.189315641s] [INFO ] [alacritty] Width: 800, Height: 600
[0.192787843s] [INFO ] [alacritty] PTY dimensions: 20 x 57
[0.196980030s] [INFO ] [alacritty] Initialisation complete
[0.201337904s] [DEBUG] [alacritty_terminal] New num_cols is 274 and num_lines is 72
[0.205233926s] [INFO ] [alacritty] Padding: 0 x 0
[0.205250015s] [INFO ] [alacritty] Width: 3840, Height: 2160
[0.260116167s] [DEBUG] [crossfont] Loaded Face Face { ft_face: Font Face: Regular, load_flags: MONOCHROME | TARGET_MONO | COLOR, render_mode: "Mono", lcd_filter: 1 }
[0.260546674s] [DEBUG] [crossfont] Loaded Face Face { ft_face: Font Face: Bold, load_flags: NO_BITMAP | TARGET_LIGHT, render_mode: "Lcd", lcd_filter: 1 }
[1.907740914s] [INFO ] [alacritty] Goodbye
Deleted log file at "/run/user/1000/Alacritty-681201.log"

I’m running tmux in alacritty, and I want to copy text, it popup a warning: image

How can I investigate this issue?

About this issue

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

Most upvoted comments

I have also had this for a while. Arch Linux, KDE plasma.

This is what I have in my .tmux.conf:

# Use vim keybindings in copy mode
set-window-option -g mode-keys vi
bind P paste-buffer
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi r send-keys -X rectangle-toggle
bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'xclip -in -selection clipboard'

The problem is only occasional and only occurs when I do the following:

ctrl+b [ to go into vi mode. v to enter visual mode. y to yank the text.

Selecting text using the mouse copies fine.

Once the problem starts it seems to keep on occurring. I can close Alacritty, start a new instance and reattach tmux and I will get the problem again. If I terminate the tmux session, restart Alacritty and then start a new tmux session, this seems to resolve the issue.

Same story for me: Fedora 39, i3, tmux

My copy command was:

bind-key -T copy-mode M-w send-keys -X copy-pipe-and-cancel “xclip -i -sel p -f | xclip -i -sel c >/dev/null”

I changed it to:

bind -Tcopy-mode M-w send -X copy-pipe-and-cancel ‘xsel -i’

Since that did not see this happening.

Same issue here, I’m on Archlinux using XFCE.

My .tmux.conf is not really small:

# Basic settings {{{
# Command prefix
unbind C-b
set-option -g prefix C-a
set -g default-terminal "${TERM}"
# Tc: enable true color
set-option -ga terminal-overrides "alacritty:Tc"
set -g status-style bg='#4E9A06',fg=black
# usstyle: underline style, independent color
# From https://github.com/alacritty/alacritty/issues/6424#issuecomment-1284047487
set-option -ga terminal-features ",alacritty:usstyle"
# Gor neovim - to fix escape lag
set -s escape-time 0
# Terminal index begins with 1 instead of 0
set -g base-index 1
# Vim-like config
set -g mode-keys vi
set -g history-limit 10000

# To debug what comands are executed and what changes the environment in bash
# set -g default-command "PS4='+$BASH_SOURCE> ' BASH_XTRACEFD=7 bash -xl 7>bash-xtrace.log"
# }}}
# Keybindings {{{
# Pane movement
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# Resize panes with vim movement keys
bind -r H resize-pane -L 5
bind -r J resize-pane -D 5
bind -r K resize-pane -U 5
bind -r L resize-pane -R 5
# Change to previous window
bind Tab select-window -l
# Open window in current path
bind C new-window -c "#{pane_current_path}"
# Open splits in current path always
bind '"' split-window -c "#{pane_current_path}"
bind '%' split-window -h -c "#{pane_current_path}"
# }}}
# Plugins {{{
# Tmux Plugin Manager
set -g @plugin 'tmux-plugins/tpm'
# Tmux sensible defaults
set -g @plugin 'tmux-plugins/tmux-sensible'
# Resurrect - save and restore sessions!
set -g @plugin 'tmux-plugins/tmux-resurrect'
# Tmux yank - copy text, better than just xclip
set -g @plugin 'tmux-plugins/tmux-yank'


# Other examples:
# set -g @plugin 'github_username/plugin_name'
# set -g @plugin 'git@github.com/user/plugin'
# set -g @plugin 'git@bitbucket.com/user/plugin'
# }}}
# tmux-resurrect config {{{
# Restore neovim sessions automatically
set -g @resurrect-strategy-nvim 'session'
# }}}

# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run -b '~/.tmux/plugins/tpm/tpm'

# vim:foldmethod=marker:foldlevel=0

As you can see I’m using https://github.com/tmux-plugins/tmux-yank instead of a manual command for copying.

The workflow to reproduce the issue (occasionally) is similar as described by @StephenWakely:

  • Enter selection mode with <c-a> [.
  • Select a text with space.
  • Yank the selection with y.

However in my case the issue sometimes goes away without doing anything: after getting the error sometimes I repeat exactly the same workflow and it works again.

Same issue on FreeBSD 15 with alacritty-0.13.2

I too am seeing this occassionally under Arch Linux with bspwm when doing tmux copy selection.