Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions CodeApp/Managers/TerminalInstance.swift
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,18 @@ class TerminalInstance: NSObject, WKScriptMessageHandler, WKNavigationDelegate {
}
openSharedFilesApp(urlString: dir)
self.readLine()
case let x where x.hasPrefix("history"):
let args = x.components(separatedBy: " ")
if args.count == 2 && args[1] == "-c" {
// Clear command history stored in local-echo.js
// This accesses the HistoryController instance (localEcho.history)
// to reset both the entries array and cursor position
executeScript("localEcho.history.entries = []; localEcho.history.cursor = 0;")
self.readLine()
} else {
// Display history - pass to ios_system for default behavior
fallthrough
}
default:
let command = result["Input"] as! String
// guard command.count > 0 else {
Expand Down
Loading