Skip to content

Linux: clipboard on wayland doesn't work #585

Closed
@salman-farooq-sh

Description

Before Proceeding, please acknowledge:

  • I have consulted the Troubleshooting guide, specifically the Copy-Paste section.
  • I have searched Issues and Discussions in this repo.
  • Feature requests should be initiated as Discussions. This is a bug report.

Describe the bug
Copying text in query editor or query results on wayland compositors with no Xwayland shows an error message: "Could not access system clipboard.". With Xwayland, everything works fine without changing anything.

To Reproduce

  1. Install and start a session of a wayland compositor which doesn't have Xwayland support e.g. niri
  2. Open a terminal window e.g. kitty
  3. Run harlequin duck.db
  4. Type some text in the query editor
  5. Select it with mouse or shift + arrow-keys
  6. Hit control + c
  7. Said error appears in the bottom right corner

Expected behavior
Text is copied with no error notification

Actual behavior
An error shows up and text is not copied.
image

Contributing
Are you interested in contributing a fix?

  • Yes (I think this is due to a dependency on xsel/xclip which only works on X11. I can contribute a fix which will use wl-clipboard instead when XDG_SESSION_TYPE is equal to 'wayland' Upon reading the code, it seems like the TUI library component textual-textarea might need updating to fix this issue)
  • Maybe
  • No

Additional context
Not relevant.

What is the output of harlequin --version?

harlequin, version 1.21.0

Installed Adapters:
  - mysql, version 0.1.3
  - odbc, version 0.1.1
  - trino, version 0.1.3
  - databricks, version 0.1.1
  - bigquery, version 1.0.2
  - adbc, version 0.1.1
  - duckdb, version 1.21.0
  - sqlite, version 1.21.0
  - postgres, version 0.2.2

What database adapter are you using with Harlequin? (Default is duckdb)
I have tried postgres and duckdb, error is present with both.

What other options are you using when invoking Harlequin? (If you are using a profile, please add relevant items from your profile here).
Not relevant.

Can you tell us more about your system?

  • Shell: fish
  • Terminal: kitty
  • OS of the shell: Arch Linux
  • OS of the terminal (if different from the shell): Arch Linux
  • Default locale / language for your OS/Terminal/Shell: echo $LC_ALL gives en_US.utf8

Tip

For example, for my system, these are:

  • Bash
  • Windows Terminal
  • Ubuntu 22.04 / WSL2
  • Windows 11
  • en_US/UTF-8

How did you install Harlequin?

  • pipx
  • conda/mamba
  • pip (global install)
  • pip + venv/virtualenv or pipenv
  • Poetry
  • uv/Rye
  • other: _____________

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions