Comment 9 for bug 1926256

Revision history for this message
Egmont Koblinger (egmont-gmail) wrote :

> You mean it will always be like this going forward?

I don't know. This was a change in the default shell "bash". I'm not involved in bash's development, nor in Ubuntu's. I don't know what their plans are. I don't know if this feature can be disabled in bash (but I know that it's bash's documentation to consult). I don't know if Ubuntu plans to disable it by default.

> Is this the feature you are referring to?...
> ..or, is it this one?...

I'm not aware of the exact details of bash's change, and I haven't tried bash-5.1 yet. Both of these look relevant, probably one of them is exactly this one.

> I find there is an inconsistency with this new approach:
> If you've just pasted text, then highlight the text, the text looks
> unhighlighted.
> This is visually confusing.

This is a good observation. gnome-terminal by default inverts the colors of each cell (I mean: swaps the background and the foreground color) when you highlight with the mouse. Now, if an application also does this (like bash now when pasting, or that one row of "top", etc.), and then you highlight with the mouse, these two operations cancel out each other and you're back to your regular colors. Both components do something that's reasonable on its own, yet the two don't work together nicely.

One possible workaround is to configure your terminal to use some fixed colors for highlighting. I, for one, have configured gnome-terminal to use the same orange-ish background that Ubuntu uses anywhere else in GTK when highlighting text. You can configure it in profile settings -> colors, or emit the OSC 17 & 19 escape sequences to achieve the same effect, e.g. «echo -ne '\e]17;#f18458\e\\'». Presumably most other terminal emulators also support this feature. This might even be something for Ubuntu to consider doing globally for all the users by default.

Alternatively, you should be able to disable this feature of bash, or configure it to use different colors rather than inverse video. I don't know if these possibilities are implemented in bash, if not then you might need to patch its source or its the developers to add such features.