Description
Describe the problem
By default, the bottom panel of the Arduino IDE window is used as the container for the Serial Monitor view. The user can configure Arduino IDE to instead use the right hand panel as the view's container by setting the "Arduino › Monitor: Dock Panel" (arduino.monitor.dockPanel
) advanced setting to "right" (#2102).
When in this configuration, Serial Monitor is opened and closed by clicking the icon on the toolbar (not the similar icon on the right hand activity bar, which only expands/collapses the panel).
🐛 If arduino.monitor.dockPanel
is set to right
and Serial Monitor is closed while the Arduino IDE window is still loading, it puts the right panel UI into a broken state.
To reproduce
- Press the Ctrl+Shift+P keyboard shortcut (Command+Shift+P for macOS users) to open the "Command Palette".
A menu will appear on the editor toolbar:
- Select the "Preferences: Open Settings (UI)" command from the menu.
ⓘ You can scroll down through the list of commands to find it or type the name in the field.
A "Settings" tab will open in the Arduino IDE main panel. - Type
arduino.monitor.dockPanel
in the "Search Settings" field of the "Settings" tab. - Select "right" from the "Arduino › Monitor: Dock Panel" setting menu.
- Close the Preferences tab by clicking its X icon.
- Select File > New Sketch from the Arduino IDE menus.
- A new sketch will open in an Arduino IDE menu.
- ⓘ I will refer to this sketch as "test sketch".
- Click the Serial Monitor icon at the right side of the Arduino IDE toolbar.
- The Serial Monitor view will open in the right hand panel of the Arduino IDE window.
- ⓘ It is not required to select a port or have an Arduino board connected to your computer to perform this demo.
- Click the Serial Monitor icon at the right side of the Arduino IDE toolbar.
🙂 The right hand panel of the Arduino IDE window closes, as expected. - Click the Serial Monitor icon at the right side of the Arduino IDE toolbar.
🙂 The Serial Monitor view opens in the right hand panel of the Arduino IDE window, as expected. - Select File > Save As... from the Arduino IDE menus.
- Save the test sketch to any convenient name and location.
- Close the Arduino IDE window of the test sketch.
- Open the test sketch again in Arduino IDE.
- As soon as the new window opens, click the Serial Monitor icon at the right side of the Arduino IDE toolbar.
- ⓘ This step is timing sensitive. If you click too soon, it doesn't have any effect. In this case, just click again until it does. Conversely, i must be performed while the window is still loading, which might be a short time window on fast/streamlined machines. If the fault doesn't occur, it may be because the window had loaded fully before you clicked the icon, so perform steps 10 - 12 again until you get the timing right.
- 🐛 The Serial Monitor view disappears from the right hand panel, but the
serial-monitor
process is not terminated, so the port is not freed up as expected. - 🐛 The right hand panel is not closed, leaving a blank area of the Arduino IDE window:
- Click the Serial Monitor icon at the right side of the Arduino IDE toolbar again.
🐛 There is no visual change (though now theserial-monitor
process is terminated). - Click the Serial Monitor icon at the right side of the Arduino IDE toolbar again.
🐛 There is no visual change, but theserial-monitor
process is launched again.
Expected behavior
Arduino IDE UI remains fully functional regardless of the timing of closing the Serial Monitor.
Arduino IDE version
2.3.6
Operating system
Windows
Operating system version
11
Additional context
I bisected the regression to 859d29d / #2654 (does not occur when using the build at the previous commit d298b3f).
Originally reported by @KurtE at https://forum.arduino.cc/t/2-3-6-and-2-3-5-closing-serial-monitor-leaves-empty-window-pane-sometimes/1372240
Additional reports
Related
Workaround
Wait for the Arduino IDE window to load fully before closing Serial Monitor.
If you encounter the problem, close the window and then open the sketch again. After reopening the sketch, the Serial Monitor should be back in a functional state again.
Issue checklist
- I searched for previous reports in the issue tracker
- I verified the problem still occurs when using the latest nightly build
- My report contains all necessary details