-
Notifications
You must be signed in to change notification settings - Fork 283
Add support for history -c to clear terminal command history
#1282
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
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: bummoblizard <38398443+bummoblizard@users.noreply.github.com>
Co-authored-by: bummoblizard <38398443+bummoblizard@users.noreply.github.com>
Co-authored-by: bummoblizard <38398443+bummoblizard@users.noreply.github.com>
history -c to clear terminal command history
| } else { | ||
| // Display history - pass to ios_system for default behavior | ||
| executor?.dispatch(command: x, isInteractive: false) { _ in | ||
| DispatchQueue.main.async { | ||
| self.readLine() | ||
| } | ||
| } | ||
| } |
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.
Can we use fallthrough here?
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.
Good suggestion! Changed to use fallthrough in commit 8ff488f. This eliminates code duplication and makes it cleaner.
|
@copilot evaluate my comment and make any necessary changes |
Use fallthrough to default case instead of duplicating dispatch logic, as suggested in code review. Co-authored-by: bummoblizard <38398443+bummoblizard@users.noreply.github.com> Co-authored-by: bummoblizard <38398443+bummoblizard@users.noreply.github.com>
historycommand handler in Swift (TerminalInstance.swift)Summary
Successfully implemented support for
history -ccommand to clear terminal command history. The implementation has been refined based on code review to usefallthroughfor better code organization.Implementation
TerminalInstance.swiftforhistorycommandshistory -cclears JavaScript-based history in local-echo.jshistorycommands usefallthroughto delegate to default caseOriginal prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.