File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -49,6 +49,28 @@ chmod +x install.sh
4949
5050---
5151
52+ ### 🔧 Configuration file
53+
54+ The configuration file is available in the ` .nshell ` folder.
55+ And he is downloaded from here: https://gist.github.com/onihilist/8bf7548dc7478f1b6af2db4bdc0c668d
56+
57+ ``` json
58+ {
59+ "configuration" : {
60+ "nshell" : {
61+ "history" : [
62+ {
63+ "expiration_time" : " 7d" ,
64+ "max_storage" : 500
65+ }
66+ ]
67+ }
68+ }
69+ }
70+ ```
71+
72+ ---
73+
5274### 🎨 Custom themes
5375
5476This is a little exemple of an custom theme.</br >
Original file line number Diff line number Diff line change @@ -30,7 +30,13 @@ public HistoryManager(string? path = null)
3030 private void Load ( )
3131 {
3232 if ( File . Exists ( _historyPath ) )
33+ {
3334 _history . AddRange ( File . ReadAllLines ( _historyPath ) ) ;
35+ }
36+ else
37+ {
38+ File . Create ( _historyPath ) . Close ( ) ;
39+ }
3440 }
3541
3642 /// <summary>
@@ -51,6 +57,7 @@ public void Add(string command)
5157 {
5258 _history . Add ( command ) ;
5359 _currentIndex = _history . Count ;
60+ File . WriteAllLines ( _historyPath , _history ) ;
5461 }
5562 }
5663
Original file line number Diff line number Diff line change @@ -300,7 +300,7 @@ private void MoveCursorWordRight()
300300
301301 private void HandleHistorySearch ( )
302302 {
303- var search = new NShell . Shell . History . HistorySearch ( _history ) ;
303+ var search = new History . HistorySearch ( _history ) ;
304304 var result = search . Search ( _initCursorPos4Console ) ;
305305
306306 if ( result != null )
You can’t perform that action at this time.
0 commit comments