Skip to content

fix: add arrow key command history navigation for macOS/Linux console#1013

Open
SaraBelle117 wants to merge 1 commit intoPathoschild:developfrom
SaraBelle117:develop
Open

fix: add arrow key command history navigation for macOS/Linux console#1013
SaraBelle117 wants to merge 1 commit intoPathoschild:developfrom
SaraBelle117:develop

Conversation

@SaraBelle117
Copy link
Copy Markdown

What does this change: Adds arrow key command history navigation for macOS/Linux console input. On Windows this works natively, but on macOS/Linux SMAPI uses Console.ReadLine() which doesn't handle arrow key escape sequences. This replaces it with a Console.ReadKey() loop on non-Windows platforms that tracks command history and allows up/down arrow navigation.

Related Issue: #1000

How it works:

  • On macOS/Linux, reads input character by character using Console.ReadKey()
  • Maintains a history list of up to 50 previous commands
  • Up/down arrow keys navigate through history
  • Backspace, Enter, and regular characters are handled manually to replicate normal input behavior

Note: I'm aware this is a new feature and that discussing on Disord first is recommended. This PR was submitted as part of a class assignment and may not be suitable for merging as-is, but feedback is welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant