Skip to content
Merged
Show file tree
Hide file tree
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
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,28 @@ chmod +x install.sh

---

### 🔧 Configuration file

The configuration file is available in the `.nshell` folder.
And he is downloaded from here: https://gist.github.com/onihilist/8bf7548dc7478f1b6af2db4bdc0c668d

```json
{
"configuration": {
"nshell": {
"history": [
{
"expiration_time": "7d",
"max_storage": 500
}
]
}
}
}
```

---

### 🎨 Custom themes

This is a little exemple of an custom theme.</br>
Expand Down
7 changes: 7 additions & 0 deletions Shell/History/HistoryManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,13 @@ public HistoryManager(string? path = null)
private void Load()
{
if (File.Exists(_historyPath))
{
_history.AddRange(File.ReadAllLines(_historyPath));
}
else
{
File.Create(_historyPath).Close();
}
}

/// <summary>
Expand All @@ -51,6 +57,7 @@ public void Add(string command)
{
_history.Add(command);
_currentIndex = _history.Count;
File.WriteAllLines(_historyPath, _history);
}
}

Expand Down
2 changes: 1 addition & 1 deletion Shell/Readline/KeyAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ private void MoveCursorWordRight()

private void HandleHistorySearch()
{
var search = new NShell.Shell.History.HistorySearch(_history);
var search = new History.HistorySearch(_history);
var result = search.Search(_initCursorPos4Console);

if (result != null)
Expand Down
Loading