-
-
Notifications
You must be signed in to change notification settings - Fork 7k
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
Take 2: Added support for automatically showing the Serial Monitor window upon successful sketch upload #1613
Conversation
…ndow upon successful sketch upload This fix was originally attempted via the following pull request but the Arduino team didn't take it (even though users have been asking for it for years). 77c869d This new pull request fixes an issue which didn't exist when I made the original pull request (over a year ago). This support is controlled via a checkbox menu item in the Tools menu ("Auto Show Serial Monitor"). The feature is *disabled by default* and is tracked by a boolean "serial.auto_show_monitor_window" in Preferences.txt. When "auto show" is disabled the Serial Monitor window behavior is unchanged (i.e. if you don't enable "auto show" the IDE will work as it always has). The serial monitor window is hidden when the sketch fails to compile. NOTE: The IDE's default behavior has *not* changed. The only difference is that a user may now *explicitly* request that the serial monitor window be shown upon automatically upon successful upload. Signed-off-by: Reed Mangino <reed@themanginos.com>
This is a great idea and long past due. Admittedly I'd prefer a "Keep serial monitor open" option which would re-open the serial monitor after successfully sending & compiling a sketch but would not open the serial monitor if it was not open before uploading the sketch. Similar but not quite the same. It looks like the serial monitor visibility is set true/false explicitly and it's actual visibility state isn't tracked anywhere. If the visibility state was stored in a boolean instead, it would be fairly straightforward to implement a "Keep serial monitor open" pref that could coexist with (or if the visibility state is stored across program instances replace) your "Auto show" pref. Using a boolean might also remove the need to change the Are preferences expensive to read/write? The visibility state itself could potentially be stored as a preference. Then during uploads, the visibility is explicitly set false and afterwards it's set to whatever the pref value is. |
Like! |
@@ -2474,12 +2510,14 @@ protected boolean handleExportCheckModified() { | |||
} | |||
|
|||
|
|||
public void handleSerial() { | |||
public void handleSerial(boolean makeVisible) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The parameter makeVisible is really needed?
Every time handleSerial(...) is called the parameter is always true
, you can just remove the parameter and always open the serial monitor (like it was before the commit).
I'm testing on linux32 trying to upload the ASCIITable example. So far it works as expected with the Uno, Mega 2560 and Mega ADK, but it doesn't with the Leonardo and Micro: the serial monitor opens but it shows no output. I guess that the same problem is present with any 32u4 based board, it seems that the serial port is opened too soon after the upload. These are the same problems experienced during our first run of tests on your previous pull request #115. Still investigating on this... |
FYI, on the mailing list someone suggested to disable the serial monitor instead of closing it during an upload, which AFAICS would also solve this issue (and to be honest, I think that disabling it might be more elegant than automatically re-opening it): https://groups.google.com/a/arduino.cc/d/msg/developers/_DQGY_Fdas8/dSeXiO6X_Y4J |
Can we get this in? |
@ArduinoBot build this please |
Merged build finished. Test FAILed. |
A similar feature implemented with #2742 |
This fix was originally attempted via the following pull request but the Arduino team didn't take it (even though users have been asking for it for years).
rmangino@77c869d
This new pull request fixes an issue which didn't exist when I made the original pull request (over a year ago).
This support is controlled via a checkbox menu item in the Tools menu ("Auto Show Serial Monitor"). The feature is disabled by default and is tracked by a boolean "serial.auto_show_monitor_window" in Preferences.txt. When "auto show" is disabled the Serial Monitor window behavior is unchanged (i.e. if you don't enable "auto show" the IDE will work as it always has).
The serial monitor window is hidden when the sketch fails to compile.
NOTE: The IDE's default behavior has not changed. The only difference is that a user may now explicitly request that the serial monitor window be shown upon automatically upon successful upload.
Signed-off-by: Reed Mangino reed@themanginos.com