pip icon indicating copy to clipboard operation
pip copied to clipboard

Use ! instead . to make "--break-system-package" clickable

Open elsamuko opened this issue 1 year ago • 5 comments

This PR changes the . as last character to !, because then I can double-click-select --break-system-package without the ..

Workflow:

  • I want to install a pip
  • pip complains:
note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
  • I double click on --break-system-packages.
  • I paste it with center mouse button
  • I remove the . <-- the PR saves this step
  • I install the package

elsamuko avatar Aug 06 '24 14:08 elsamuko

PS: I did not create a NEWS entry, because this is a very minor fix. How do I add a no-news-marker?

elsamuko avatar Aug 06 '24 14:08 elsamuko

This looks more like a bug in your terminal emulator, not a thing worth changing in the code base TBH.

uranusjr avatar Aug 07 '24 05:08 uranusjr

@uranusjr This is the default behaviour at least in

  • guake
  • xfce4-terminal
  • gnome-terminal
  • konsole
  • terminator
  • tilix
  • tilda
  • cool-retro-term
  • alacritty

So this fix would be nice for users of these terminal emulators.

elsamuko avatar Aug 07 '24 14:08 elsamuko

An exclamation mark gives the message a different meaning, which I don't think we should do. And (at least on Windows Terminal) double clicking includes the ! just as much as it includes the .. In any case, I agree with @uranusjr - take this up with your terminal emulator developers if you don't like this behaviour. It's not like other applications use options that end with a dot, so this would be just as much of an issue everywhere. Personally, in situations like this, I either select using a mouse drag, or double click and then delete the extra charater when I paste. It's really not that hard.

Also, the message isn't intended for easy copy/paste. It's explicitly saying this is a bad thing to do - why should we make it easy to do it anyway?

pfmoore avatar Aug 07 '24 15:08 pfmoore

Hm, instead of the !, a . or a ; could be used too.

I thought that it would make it easier to try out a python module, even if it can mess with the python installation.

elsamuko avatar Aug 07 '24 19:08 elsamuko

I'm going to close this PR as we do not want to make it easier for users to ignore this safeguard. Thank you for your interest in improving pip, but this isn't in scope.

ichard26 avatar Dec 07 '24 20:12 ichard26