Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make stderr output more copy-friendly #840

Closed
estebank opened this issue Sep 6, 2022 · 5 comments · Fixed by #972
Closed

Make stderr output more copy-friendly #840

estebank opened this issue Sep 6, 2022 · 5 comments · Fixed by #972

Comments

@estebank
Copy link

estebank commented Sep 6, 2022

When copying the stderr output from the compiler, it seems the clipboard now contains markdown for the link around error codes in the main message (or maybe it's HTML and pasting in GH turns it into markdown). This is causing unnecessarily verbose output in reports. I believe that in most cases people desire just the textual representation of errors, the link structure being either redundant or unnecessary. I would love it if we could capture the on copy event and only push the bare textual output to the clipboard.

@shepmaster
Copy link
Member

Yes, this is the browser / GitHub doing it. For example:

2022-09-06 10 45 33

I don't particularly relish attempting to subvert how the OS / browser / GitHub perform core functionality such as copy and paste...

@shepmaster
Copy link
Member

unnecessarily verbose output in reports

I did try to help with that case but was requested to stop.

@shepmaster
Copy link
Member

desire just the textual representation of errors

This can be done by the user by using "Paste and Match Style" or the equivalent browser / OS options.

@estebank
Copy link
Author

estebank commented Sep 6, 2022

I agree that this is a case of "the browser and GH being too smart by half", but I'm seeing the effects it's having on our tickets. Sadly any solution that relies on users being proactive will never have perfect compliance.

I did try to help with that case but was #671.

That seems to be related but not quite the same thing I was thinking of when I opened this. People that file issues will link to the playground and manually copy paste things. To be honest, I haven't seen the spammy tickets originated in the playground :)

@jsha
Copy link

jsha commented Sep 22, 2022

I was curious to see some examples of this problem and searched the Rust issues list:

https://github.com/rust-lang/rust/issues?q=is%3Aissue+is%3Aopen+%22https%3A%2F%2Fdoc.rust-lang.org%2Fstable%2Ferror-index.html%22

A small handful:

rust-lang/rust#101972
rust-lang/rust#101880
rust-lang/rust#101823

Interestingly, even though the filename/line combos (e.g. src/main.rs:9) are hyperlinks in the stderr output, they don't get Markdown-ified when pasted into issues. I suspect that's because they have href="#" and are handled by JavaScript. That suggests one strategy for handling the E0554 links and copy-paste: make them href="#" as well, and handle clicks using JavaScript rather than generating them as hyperlinks direct to their target.

notriddle added a commit to notriddle/rust-playground that referenced this issue Sep 14, 2023
shepmaster pushed a commit to notriddle/rust-playground that referenced this issue Sep 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants