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

Free serial port when panel of the Serial Monitor view is collapsed #2491

Open
3 tasks done
per1234 opened this issue Aug 13, 2024 · 1 comment
Open
3 tasks done

Free serial port when panel of the Serial Monitor view is collapsed #2491

per1234 opened this issue Aug 13, 2024 · 1 comment
Labels
topic: code Related to content of the project itself topic: serial monitor Related to the Serial Monitor type: enhancement Proposed improvement

Comments

@per1234
Copy link
Contributor

per1234 commented Aug 13, 2024

Describe the request

When the Serial Monitor view is opened, the monitor opens the selected port. When the view is closed, the port is closed, allowing it to be used by other processes.

The bottom panel or right side panel of the Arduino IDE window serve as the containers for the Serial Monitor view.

The user can control the visibility of these panels. From a user's perspective, there isn't a significant difference between collapsing the panel in which the view is located and closing the view because either results in the visual disappearance of the view. However, there is a significant functional difference in that the port remains open in Serial Monitor when its view is collapsed. Not realizing that the port is still being used can be problematic because it blocks any other application (even including Arduino IDE's own firmware updater and upload operation in some cases) from opening the port.

🙂 A more intuitive behavior would be for Serial Monitor to close the port when the view's panel is collapsed.

Demo

  1. 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:
    Command Palette
  2. 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 "Preferences" tab will open in the Arduino IDE main panel.
  3. Type arduino.monitor.dockPanel in the "Search Settings" field of the "Preferences" tab.
  4. Select "right" from the menu under the "Arduino › Monitor: Dock Panel" setting.
    The behavior is not specific to the right panel, but the demo is more compelling in this configuration. The reason being that the right panel is only used for the Serial Monitor view and its toggle control is very discoverable, so the user is likely to collapse the right panel during normal use. Conversely, since the bottom panel is also the container for the frequently used "Output" view, and since its primary toggle control is less discoverable, the user is less likely to ever collapse the bottom panel.
  5. Close the Preferences tab by clicking its X icon.
  6. Select any port from the Tools > Port menu.
  7. Select Tools > Serial Monitor from the Arduino IDE menus.
    The Serial Monitor view opens in the right side panel.
  8. Click the magnifying icon in the right activity bar.
    The right side panel collapses, making the Serial Monitor view no longer visible.
  9. Open the port in any other application.
    You can use arduino cli monitor for this purpose, the Arduino IDE 1.x Serial Monitor, a standalone terminal emulator like PuTTY, or whatever else you have on hand.
    🙁 The other application can't open the port.
  10. Click the "Serial Monitor" icon on the Arduino IDE 2.x toolbar.
    The right activity bar disappears.
  11. Open the port in any other application.
    😕 The application is now able to open the port.

Note that these two icons are very similar, and adjacent, yet have very different functions. The difference between the two is not well communicated to the user:

image

Arduino IDE version

aa9b10d

Operating system

  • Windows

Operating system version

  • Windows 11

Additional context

Originally reported by @mjs513 at https://forum.arduino.cc/t/should-we-still-report-and-check-for-semi-minor-issues-and-annoyances/1290531/9

Issue checklist

  • I searched for previous requests in the issue tracker
  • I verified the feature was still missing when using the latest nightly build
  • My request contains all necessary details
@per1234 per1234 added type: enhancement Proposed improvement topic: code Related to content of the project itself topic: serial monitor Related to the Serial Monitor labels Aug 13, 2024
@Lorandil
Copy link

I'm not 100% sure, but if collapsing the view frees the port, what happens if I want to see the output again?
Wouldn't reconnecting cause an Arduino Uno to reset? Is that 'intuitive behaviour'?
If this is so, the behaviour on collapsing should at least be an option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself topic: serial monitor Related to the Serial Monitor type: enhancement Proposed improvement
Projects
None yet
Development

No branches or pull requests

2 participants