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

Take 2: Added support for automatically showing the Serial Monitor window upon successful sketch upload #1613

Closed
wants to merge 1 commit into from

Conversation

rmangino
Copy link

@rmangino rmangino commented Oct 9, 2013

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

…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>
@patricktokeeffe
Copy link

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 handleSerial() signature.

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.

@KurTell
Copy link

KurTell commented Jan 12, 2014

Like!
Please merge this pull request. I keep pressing Command+U, Command+Shift+M over and over and over and over again. It's time to automatically re-open the Serial Monitor. Who would not want this? Especially if one would keep track if the Serial Monitor was open before.

@@ -2474,12 +2510,14 @@ protected boolean handleExportCheckModified() {
}


public void handleSerial() {
public void handleSerial(boolean makeVisible) {
Copy link
Member

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).

@cmaglie
Copy link
Member

cmaglie commented Feb 14, 2014

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...

@matthijskooijman
Copy link
Collaborator

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

@cmaglie
Copy link
Member

cmaglie commented Feb 26, 2014

The "disable-serial-monitor" patch has been published here:
#1891

I'll try it on the Leonardo and see if it has the same problem on the Leonardo board reset.

Another issue that may be related is here: #1203

@ghost
Copy link

ghost commented Sep 30, 2014

Can we get this in?

@cmaglie
Copy link
Member

cmaglie commented Oct 1, 2014

@ArduinoBot build this please

@ArduinoBot
Copy link
Contributor

Merged build finished. Test FAILed.

@cmaglie cmaglie added feature request A request to make an enhancement (not a bug fix) Component: IDE user interface The Arduino IDE's user interface and removed Component: IDE The Arduino IDE labels Apr 15, 2015
@ffissore ffissore self-assigned this May 12, 2015
@ffissore
Copy link
Contributor

A similar feature implemented with #2742

@ffissore ffissore closed this May 22, 2015
@ffissore ffissore added this to the Release 1.6.5 milestone May 22, 2015
@per1234 per1234 added the Component: IDE Serial monitor Tools > Serial Monitor label Apr 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: IDE Serial monitor Tools > Serial Monitor Component: IDE user interface The Arduino IDE's user interface feature request A request to make an enhancement (not a bug fix)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants