Skip to content

Add serial monitor command history #8674

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

Closed

Conversation

Pieter12345
Copy link
Contributor

The behavior is as follows:

  • Pressing the UP key will select older commands.
  • Pressing the DOWN key will select newer commands, restoring the last unexecuted command if available.
  • Pressing the ESC key will reset the input field to the latest unexecuted command and reset the traversal location. Pressing ESC while the latest unexecuted command is selected will clear the input field.

This fixes #4891, with the difference that the proposed solution has a command history per Arduino session and this implementation has a command history per serial monitor start.

@facchinm
Copy link
Member

@ArduinoBot build this please

@facchinm facchinm added feature request A request to make an enhancement (not a bug fix) Component: IDE user interface The Arduino IDE's user interface Component: IDE Serial monitor Tools > Serial Monitor labels Mar 20, 2019
The behavior is as follows:
- Pressing the UP key will select older commands.
- Pressing the DOWN key will select newer commands, restoring the last unexecuted command if available.
- Pressing the ESC key will reset the input field to the latest unexecuted command and reset the traversal location. Pressing ESC while the latest unexecuted command is selected will clear the input field.

This fixes arduino#4891, with the difference that the proposed solution has a command history per Arduino session and this implementation has a command history per serial monitor start.
@Pieter12345 Pieter12345 force-pushed the serial-monitor-command-history branch from a0d8387 to 82c67b0 Compare March 29, 2019 01:52
@Pieter12345
Copy link
Contributor Author

Rebased this PR onto master.

- Use LinkedList with ListIterator to make all methods except for `clear()` run in `O(1)` (constant runtime) instead of `O(n)` (linear runtime).
- No longer store executed commands that are executed multiple times (executing {1, 1, 1, 1, 2} now only adds {1, 2} to the history).
@Pieter12345 Pieter12345 force-pushed the serial-monitor-command-history branch from 496e6ff to fe75b82 Compare March 30, 2019 23:49
@facchinm
Copy link
Member

Manually rebased and merged, thanks!

@facchinm facchinm closed this Jul 18, 2019
@facchinm facchinm added this to the Release 1.8.10 milestone Jul 18, 2019
@per1234 per1234 added the Type: Duplicate Another item already exists for this topic label Sep 3, 2022
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) Type: Duplicate Another item already exists for this topic
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[REQ] Ability to recall previously sent strings in Serial Monitor
4 participants