nercone-shell 0.3.6__tar.gz → 0.3.7__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {nercone_shell-0.3.6 → nercone_shell-0.3.7}/PKG-INFO +14 -2
- {nercone_shell-0.3.6 → nercone_shell-0.3.7}/README.md +13 -1
- {nercone_shell-0.3.6 → nercone_shell-0.3.7}/pyproject.toml +1 -1
- {nercone_shell-0.3.6 → nercone_shell-0.3.7}/src/nercone_shell/__main__.py +10 -3
- {nercone_shell-0.3.6 → nercone_shell-0.3.7}/src/nercone_shell/__init__.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: nercone-shell
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.7
|
|
4
4
|
Summary: Modern shell for Developers
|
|
5
5
|
Author: Nercone
|
|
6
6
|
Author-email: Nercone <nercone@diamondgotcat.net>
|
|
@@ -72,7 +72,7 @@ The configuration file is usually located at `~/.nercone/nercone-shell/config.js
|
|
|
72
72
|
If the file does not exist when Nersh starts, it will be automatically created.
|
|
73
73
|
|
|
74
74
|
The following is the default configuration file:
|
|
75
|
-
```
|
|
75
|
+
```json
|
|
76
76
|
{
|
|
77
77
|
"customization": {
|
|
78
78
|
"show_version": true,
|
|
@@ -86,6 +86,9 @@ The following is the default configuration file:
|
|
|
86
86
|
},
|
|
87
87
|
"compatibility": {
|
|
88
88
|
"report_invisible_characters": false
|
|
89
|
+
},
|
|
90
|
+
"experimental": {
|
|
91
|
+
"command_history": false
|
|
89
92
|
}
|
|
90
93
|
}
|
|
91
94
|
```
|
|
@@ -100,3 +103,12 @@ These settings customize the behavior of Nersh.
|
|
|
100
103
|
### Compatibility
|
|
101
104
|
This setting allows Nersh to function properly in special environments.
|
|
102
105
|
- `report_invisible_characters`: A Boolean value that enables reporting of invisible characters to readline, which is necessary in some environments, such as Linux without a GUI (TUI only).
|
|
106
|
+
|
|
107
|
+
### Experimental
|
|
108
|
+
The Experimental setting is used to enable experimental features.
|
|
109
|
+
It enables new features that are incomplete, have many bugs, or have unfixable bugs.
|
|
110
|
+
Some features are difficult to completely disable, so they are effectively disabled. (Bugs in external libraries/modules, etc.)
|
|
111
|
+
|
|
112
|
+
- `command_history` The readline command history feature.
|
|
113
|
+
- It was marked as an experimental feature because there were frequent issues with the layout collapsing when retracing the history.
|
|
114
|
+
- Since cannot to find a way to disable the history feature in the readline module, it is effectively disabled by clearing the history after each input.
|
|
@@ -57,7 +57,7 @@ The configuration file is usually located at `~/.nercone/nercone-shell/config.js
|
|
|
57
57
|
If the file does not exist when Nersh starts, it will be automatically created.
|
|
58
58
|
|
|
59
59
|
The following is the default configuration file:
|
|
60
|
-
```
|
|
60
|
+
```json
|
|
61
61
|
{
|
|
62
62
|
"customization": {
|
|
63
63
|
"show_version": true,
|
|
@@ -71,6 +71,9 @@ The following is the default configuration file:
|
|
|
71
71
|
},
|
|
72
72
|
"compatibility": {
|
|
73
73
|
"report_invisible_characters": false
|
|
74
|
+
},
|
|
75
|
+
"experimental": {
|
|
76
|
+
"command_history": false
|
|
74
77
|
}
|
|
75
78
|
}
|
|
76
79
|
```
|
|
@@ -85,3 +88,12 @@ These settings customize the behavior of Nersh.
|
|
|
85
88
|
### Compatibility
|
|
86
89
|
This setting allows Nersh to function properly in special environments.
|
|
87
90
|
- `report_invisible_characters`: A Boolean value that enables reporting of invisible characters to readline, which is necessary in some environments, such as Linux without a GUI (TUI only).
|
|
91
|
+
|
|
92
|
+
### Experimental
|
|
93
|
+
The Experimental setting is used to enable experimental features.
|
|
94
|
+
It enables new features that are incomplete, have many bugs, or have unfixable bugs.
|
|
95
|
+
Some features are difficult to completely disable, so they are effectively disabled. (Bugs in external libraries/modules, etc.)
|
|
96
|
+
|
|
97
|
+
- `command_history` The readline command history feature.
|
|
98
|
+
- It was marked as an experimental feature because there were frequent issues with the layout collapsing when retracing the history.
|
|
99
|
+
- Since cannot to find a way to disable the history feature in the readline module, it is effectively disabled by clearing the history after each input.
|
|
@@ -48,6 +48,9 @@ NERSH_CONFIG_DEFAULT: dict = {
|
|
|
48
48
|
},
|
|
49
49
|
"compatibility": {
|
|
50
50
|
"report_invisible_characters": False
|
|
51
|
+
},
|
|
52
|
+
"experimental": {
|
|
53
|
+
"command_history": False
|
|
51
54
|
}
|
|
52
55
|
}
|
|
53
56
|
|
|
@@ -253,7 +256,8 @@ def run_line(command: str) -> int:
|
|
|
253
256
|
print(f"nersh: {target}: No such file")
|
|
254
257
|
return 1
|
|
255
258
|
elif cmd == "exit":
|
|
256
|
-
|
|
259
|
+
if NERSH_CONFIG.get("experimental", {}).get("command_history", False):
|
|
260
|
+
readline.write_history_file(str(NERSH_HISTORY_PATH))
|
|
257
261
|
try:
|
|
258
262
|
raise SystemExit(int(args[1]))
|
|
259
263
|
except IndexError:
|
|
@@ -287,7 +291,7 @@ def main() -> int:
|
|
|
287
291
|
print(f"(autorun failed) Not exist: {p}")
|
|
288
292
|
if NERSH_AUTORUN:
|
|
289
293
|
run_script(NERSH_AUTORUN)
|
|
290
|
-
if NERSH_HISTORY_PATH.is_file():
|
|
294
|
+
if NERSH_CONFIG.get("experimental", {}).get("command_history", False) and NERSH_HISTORY_PATH.is_file():
|
|
291
295
|
readline.read_history_file(NERSH_HISTORY_PATH)
|
|
292
296
|
while True:
|
|
293
297
|
try:
|
|
@@ -296,12 +300,15 @@ def main() -> int:
|
|
|
296
300
|
color_accent = f"{RL_PROMPT_START_IGNORE}{ModernColor.color(NERSH_CONFIG.get('customization', {}).get('accent_color', 'blue'))}{RL_PROMPT_END_IGNORE}"
|
|
297
301
|
color_reset = f"{RL_PROMPT_START_IGNORE}{ModernColor.color('reset')}{RL_PROMPT_END_IGNORE}"
|
|
298
302
|
run_line(input(f"{color_accent}{getpass.getuser().lower()}{color_reset}@{hostname.lower()} {color_accent}{shorten_path(ENVIRONMENT.get('PWD', f'{Path('~').expanduser()}'))}{color_reset}> "))
|
|
303
|
+
if not NERSH_CONFIG.get("experimental", {}).get("command_history", False):
|
|
304
|
+
readline.clear_history()
|
|
299
305
|
except KeyboardInterrupt:
|
|
300
306
|
print()
|
|
301
307
|
continue
|
|
302
308
|
except EOFError:
|
|
303
309
|
print()
|
|
304
|
-
|
|
310
|
+
if NERSH_CONFIG.get("experimental", {}).get("command_history", False):
|
|
311
|
+
readline.write_history_file(str(NERSH_HISTORY_PATH))
|
|
305
312
|
break
|
|
306
313
|
|
|
307
314
|
if __name__ == "__main__":
|
|
File without changes
|