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

Upgrade notification command does not copy properly due to box borders #9239

Closed
3 tasks done
trigaten opened this issue Aug 17, 2023 · 6 comments · Fixed by #9309
Closed
3 tasks done

Upgrade notification command does not copy properly due to box borders #9239

trigaten opened this issue Aug 17, 2023 · 6 comments · Fixed by #9309
Labels
bug An error in the Docusaurus core causing instability or issues with its execution domain: dx Related to developer experience of working on Docusaurus sites good first issue If you are just getting started with Docusaurus, this issue should be a good place to begin. status: accepting pr This issue has been accepted, and we are looking for community contributors to implement this

Comments

@trigaten
Copy link

trigaten commented Aug 17, 2023

Have you read the Contributing Guidelines on issues?

Prerequisites

  • I'm using the latest version of Docusaurus.
  • I have read the console error message carefully (if applicable).

Description

Summary

It appears that the text does not copy properly from this docusaurus warning message. The file which generates this message is packages/docusaurus/bin/beforeCli.mjs. This could be a non-docusaurus specific problem, but it does not appear to be a shell problem (I tried with zsh and bash).

Screenshot 2023-08-17 at 4 24 24 PM

I recently got this upgrade note, and wanted to upgrade my docusaurus version. I copy and pasted the command into my terminal, but the following happened:

(base) sanderschulhoff@Sanders-MacBook-Pro Learn_Prompting % npm i @docusaurus/core@latest @docusaurus/plugin-client-redirects@latest @docusaurus/plugin-google-analytics@latest     │
   │          @docusaurus/plugin-ideal-image@latest @docusaurus/preset-classic@latest @docusaurus/theme-mermaid@latest           │
   │                                          @docusaurus/module-type-aliases@latest
npm ERR! code EINVALIDTAGNAME
npm ERR! Invalid tag name "" of package "": Tags may not have any characters that encodeURIComponent encodes.

npm ERR! A complete log of this run can be found in: /Users/sanderschulhoff/.npm/_logs/2023-08-17T23_20_04_692Z-debug-0.log
zsh: command not found: │
zsh: command not found: │

The | were quite weird as they didn't appear in the image I uploaded. I pasted the text elsewhere, and found that it pasted as:

npm i @docusaurus/core@latest @docusaurus/plugin-client-redirects@latest @docusaurus/plugin-google-analytics@latest     │
   │          @docusaurus/plugin-ideal-image@latest @docusaurus/preset-classic@latest @docusaurus/theme-mermaid@latest           │
   │                                          @docusaurus/module-type-aliases@latest

The terminal (a zsh shell) could not properly handle it. I asked GPT-4 to reformat it, and it gave me the following, which ran properly.

npm i @docusaurus/core@latest \
      @docusaurus/plugin-client-redirects@latest \
      @docusaurus/plugin-google-analytics@latest \
      @docusaurus/plugin-ideal-image@latest \
      @docusaurus/preset-classic@latest \
      @docusaurus/theme-mermaid@latest \
      @docusaurus/module-type-aliases@latest

Reproducible demo

No response

Steps to reproduce

  1. Run these individually:
npm install @docusaurus/core@2.4.0 @docusaurus/preset-classic@2.4.0
npx docusaurus --version
  1. Copy the command output (between the backticks):
Screenshot 2023-08-17 at 4 39 05 PM
  1. Paste the command into the terminal and attempt to run it.

Your environment

Screenshot 2023-08-17 at 4 41 53 PM

npx version: 9.7.2
node version: v20.4.0

VSCode, a bash or zsh terminal

Self-service

@trigaten trigaten added bug An error in the Docusaurus core causing instability or issues with its execution status: needs triage This issue has not been triaged by maintainers labels Aug 17, 2023
@Josh-Cena
Copy link
Collaborator

I'm okay to get rid of the box, if it makes the command easier to copy. However it should be immediately obvious for most people that the box borders are also copiable characters so you need to copy them one line at a time.

@Josh-Cena Josh-Cena changed the title [MacOS] To upgrade Docusaurus packages with the latest version... command does not copy properly Upgrade notification command does not copy properly due to box borders Aug 18, 2023
@Josh-Cena Josh-Cena added domain: dx Related to developer experience of working on Docusaurus sites and removed status: needs triage This issue has not been triaged by maintainers labels Aug 18, 2023
@trigaten
Copy link
Author

it should be immediately obvious for most people that the box borders are also copiable characters so you need to copy them one line at a time.

Could you explain this further? I am only copying the text between the backticks. There is only one npm i command, which should be directly copiable.

@Josh-Cena
Copy link
Collaborator

This box you see is entirely comprised of text. When you copy text across multiple lines, you always copy the entire line, so the borders, which are pipe characters, are also copied.

@trigaten
Copy link
Author

Ah, that makes sense. I did not think of this :)

Removing the box (or making it uncopiable?) would be good for usability. Thanks for walking me through this!

@homotechsual
Copy link
Contributor

I'm in favour of removing the box here - we should favour usability (the copiable command) rather than "style" in terminal output imo :-)

@slorber
Copy link
Collaborator

slorber commented Sep 7, 2023

Ok to remove the box 👍 hope we can find a terminal display that's not too ugly and stand out a bit.

Accepting external contributor PRs. Don't claim: first draft PR gets assigned the issue.

@slorber slorber added good first issue If you are just getting started with Docusaurus, this issue should be a good place to begin. status: accepting pr This issue has been accepted, and we are looking for community contributors to implement this labels Sep 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An error in the Docusaurus core causing instability or issues with its execution domain: dx Related to developer experience of working on Docusaurus sites good first issue If you are just getting started with Docusaurus, this issue should be a good place to begin. status: accepting pr This issue has been accepted, and we are looking for community contributors to implement this
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants