Skip to content

Conversation

@h-michaelson20
Copy link
Contributor

@h-michaelson20 h-michaelson20 commented Oct 20, 2025

Description

Fixes the copy button functionality in REPL interactive mode error output sections.

When executing Python code that produces errors in the REPL (e.g., NameError), the copy button in the error output section was unresponsive. The stdout/stderr copy button worked correctly, but the error traceback section copy button had no effect when clicked.

Fixes #40207

Changes

Modified the following:
src/outputs.rs: Fixed context issues in render_output_controls by replacing cx.listener() with simple closures, and added custom button implementation for ErrorOutput that copies/opens the complete error (name + message + traceback)
src/outputs/plain.rs: Made full_text() method public to allow access from button handlers
src/outputs/user_error.rs: Added Clone derive to ErrorView struct and removed a couple pieces of commented code

Why This Matters

The copy button was clearly broken and it is useful to have for REPL workflows. Users could potentially need to copy error messages for a variety of reasons.

Testing

See attached demo for proof that the fix is working as intended. (this is my first ever commit, if there are additional test cases I need to write or run, please let me know!)

Screen.Recording.2025-10-19.at.10.15.06.PM.mov

Release Notes:

  • Fixed copy button not working for REPL error output

@cla-bot
Copy link

cla-bot bot commented Oct 20, 2025

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Henry Michaelson.
This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commits git config --list | grep email
  2. If not, set it up using git config --global user.email [email protected]
  3. Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails

@maxdeviant maxdeviant changed the title Fix: Copy button not working for REPL error output (issue #40207) Fix copy button not working for REPL error output Oct 20, 2025
Copy link
Member

@Veykril Veykril left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@Veykril
Copy link
Member

Veykril commented Oct 20, 2025

You'll need to sign the CLA for us to merge this.

@cla-bot
Copy link

cla-bot bot commented Oct 20, 2025

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Henry Michaelson.
This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commits git config --list | grep email
  2. If not, set it up using git config --global user.email [email protected]
  3. Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails

@cla-bot
Copy link

cla-bot bot commented Oct 20, 2025

The cla-bot has been summoned, and re-checked this pull request!

@h-michaelson20 h-michaelson20 force-pushed the fix-repl-copy-button-40207 branch from 8f8a74a to e0f7f2d Compare October 20, 2025 23:24
@cla-bot
Copy link

cla-bot bot commented Oct 20, 2025

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Henry Michaelson.
This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commits git config --list | grep email
  2. If not, set it up using git config --global user.email [email protected]
  3. Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails

@h-michaelson20 h-michaelson20 force-pushed the fix-repl-copy-button-40207 branch from e0f7f2d to 7c43d84 Compare October 20, 2025 23:27
@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Oct 20, 2025
@h-michaelson20
Copy link
Contributor Author

@Veykril Done! Thank you.

- Fixed copy button functionality in REPL error output section
- Ensured both stdout/stderr and error sections have working copy buttons

Fixes zed-industries#40207
@Veykril Veykril force-pushed the fix-repl-copy-button-40207 branch from 05b1492 to 0384fc4 Compare October 26, 2025 10:14
@SomeoneToIgnore SomeoneToIgnore merged commit 4778d61 into zed-industries:main Oct 28, 2025
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

copy button(s) do not work in REPL interactive mode

3 participants