Highlighting source code does not allow text to be pasted using Middle Click on Linux versions of Firefox

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

Problem

Normally, highlighting text within an X11 environment places that text in a copy buffer, which can be extracted by using middle click on the mouse.

In Bitbucket Server, under certain conditions, highlighting source code does not automatically place the text within the middle mouse copy buffer, but highlighting other elements does work properly.

Diagnosis

Environment

  • Linux and Firefox

Cause

Bitbucket Server uses a Javascript library called Codemirror to handle the display of source. This issue is tracked here, but the underlying issue is that Firefox does not fire a copy event when the DOM element is not being focused (which is incorrect according to spec). This is being tracked in this bug for Mozilla Firefox.

Solution

Resolution or Workaround

There is no workaround at this time, other to use a different browser that handles this properly, such as Chrome.

Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.