feat: add a save-output action to the Serial Monitor - #2937
Open
iblackscreen wants to merge 1 commit into
Open
Conversation
Saving the Serial Monitor output to a file is a long-standing request (arduino#549). Until now the only way was copy/paste, which is limited by the selection issues around the virtualized output. This adds a Save Output toolbar button next to Copy Output. It opens the native save dialog (default file name serial-monitor-YYYYMMDD-HHMMSS.txt, filters for .txt/.log and all files) and writes the currently buffered output as plain text, produced by the exact same logic as the Copy Output button: raw output, null characters replaced with a visible symbol, no timestamps (shared helper linesToPlainText). A short confirmation notification is shown after saving, following the Archive Sketch pattern. This saves the currently buffered output (up to 1,000,000 characters), same as the copy button. Continuous background logging to a file is a different feature and out of scope. Fixes arduino#549
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Saving the Serial Monitor output to a file is a long-standing request (#549). Until now the only
way was copy and paste, which is limited by the selection issues around the virtualized output.
In physics classes, where Arduinos often serve as low-cost measurement instruments, saving a
recorded run directly from the Serial Monitor replaces a fiddly copy-and-paste step.
#2718 introduced a
Copy Outputtoolbar button backed by the monitor's internal line buffer.This PR adds the matching
Save Outputaction.Change description
Save Outputtoolbar button next toCopy Output, backed by a newserial-monitor-save-outputcommand.serial-monitor-YYYYMMDD-HHMMSS.txt, filters for.txt/.logand all files) and writes thecurrently buffered output as plain text.
Copy Output(linesToPlainText): raw output,null characters replaced with a visible symbol, no timestamps.
Archive Sketchpattern.Other information
This saves the currently buffered output (up to
MAX_CHARACTERS, 1,000,000 characters), same asthe copy button. Continuous background logging to a file is a different feature and out of scope
here.
Fixes #549