nercone-shell 0.2.8__tar.gz → 0.3.0__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.2.8 → nercone_shell-0.3.0}/PKG-INFO +8 -1
- {nercone_shell-0.2.8 → nercone_shell-0.3.0}/README.md +7 -0
- {nercone_shell-0.2.8 → nercone_shell-0.3.0}/pyproject.toml +1 -1
- {nercone_shell-0.2.8 → nercone_shell-0.3.0}/src/nercone_shell/__main__.py +3 -2
- {nercone_shell-0.2.8 → nercone_shell-0.3.0}/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
|
+
Version: 0.3.0
|
|
4
4
|
Summary: Modern shell for Developers
|
|
5
5
|
Author: Nercone
|
|
6
6
|
Author-email: Nercone <nercone@diamondgotcat.net>
|
|
@@ -61,6 +61,11 @@ pip3 install nercone-shell --upgrade --break-system-packages
|
|
|
61
61
|
pip3 install nercone-shell --upgrade
|
|
62
62
|
```
|
|
63
63
|
|
|
64
|
+
## Usage
|
|
65
|
+
```
|
|
66
|
+
nersh
|
|
67
|
+
```
|
|
68
|
+
|
|
64
69
|
## Configuration
|
|
65
70
|
The configuration file is usually located at `~/.nercone/nercone-shell/config.json`.
|
|
66
71
|
If the file does not exist when Nersh starts, it will be automatically created.
|
|
@@ -70,6 +75,7 @@ The following is the default configuration file:
|
|
|
70
75
|
{
|
|
71
76
|
"customization": {
|
|
72
77
|
"show_version": true,
|
|
78
|
+
"accent_color": "blue",
|
|
73
79
|
"override_env": {
|
|
74
80
|
"SHELL": "None"
|
|
75
81
|
},
|
|
@@ -86,6 +92,7 @@ The following is the default configuration file:
|
|
|
86
92
|
### Customization
|
|
87
93
|
These settings customize the behavior of Nersh.
|
|
88
94
|
- `show_version`: Sets whether to display version information at startup.
|
|
95
|
+
- `accent_color`: Accent color used for prompts etc.
|
|
89
96
|
- `override_env`: Sets the environment variables you want to set at startup in dictionary format.
|
|
90
97
|
- `autoruns`: Sets the shell scripts you want to run at startup in array format.
|
|
91
98
|
|
|
@@ -47,6 +47,11 @@ pip3 install nercone-shell --upgrade --break-system-packages
|
|
|
47
47
|
pip3 install nercone-shell --upgrade
|
|
48
48
|
```
|
|
49
49
|
|
|
50
|
+
## Usage
|
|
51
|
+
```
|
|
52
|
+
nersh
|
|
53
|
+
```
|
|
54
|
+
|
|
50
55
|
## Configuration
|
|
51
56
|
The configuration file is usually located at `~/.nercone/nercone-shell/config.json`.
|
|
52
57
|
If the file does not exist when Nersh starts, it will be automatically created.
|
|
@@ -56,6 +61,7 @@ The following is the default configuration file:
|
|
|
56
61
|
{
|
|
57
62
|
"customization": {
|
|
58
63
|
"show_version": true,
|
|
64
|
+
"accent_color": "blue",
|
|
59
65
|
"override_env": {
|
|
60
66
|
"SHELL": "None"
|
|
61
67
|
},
|
|
@@ -72,6 +78,7 @@ The following is the default configuration file:
|
|
|
72
78
|
### Customization
|
|
73
79
|
These settings customize the behavior of Nersh.
|
|
74
80
|
- `show_version`: Sets whether to display version information at startup.
|
|
81
|
+
- `accent_color`: Accent color used for prompts etc.
|
|
75
82
|
- `override_env`: Sets the environment variables you want to set at startup in dictionary format.
|
|
76
83
|
- `autoruns`: Sets the shell scripts you want to run at startup in array format.
|
|
77
84
|
|
|
@@ -32,6 +32,7 @@ NERSH_CONFIG_PATH = Path(os.environ.get("NERSH_CONFIG_PATH", str(Path(NERSH_PATH
|
|
|
32
32
|
NERSH_CONFIG_DEFAULT: dict = {
|
|
33
33
|
"customization": {
|
|
34
34
|
"show_version": True,
|
|
35
|
+
"accent_color": "blue",
|
|
35
36
|
"override_env": {
|
|
36
37
|
"SHELL": f"{shutil.which('nersh')}"
|
|
37
38
|
},
|
|
@@ -284,11 +285,11 @@ def main() -> int:
|
|
|
284
285
|
readline.read_history_file(NERSH_HISTORY_PATH)
|
|
285
286
|
RL_PROMPT_START_IGNORE = "\001" if NERSH_CONFIG.get("compatibility", {}).get("report_invisible_characters", False) else ""
|
|
286
287
|
RL_PROMPT_END_IGNORE = "\002" if NERSH_CONFIG.get("compatibility", {}).get("report_invisible_characters", False) else ""
|
|
287
|
-
|
|
288
|
+
color_accent = f"{RL_PROMPT_START_IGNORE}{NERSH_CONFIG.get('customization', {}).get('accent_color', 'blue')}{RL_PROMPT_END_IGNORE}"
|
|
288
289
|
color_reset = f"{RL_PROMPT_START_IGNORE}{ModernColor.color('reset')}{RL_PROMPT_END_IGNORE}"
|
|
289
290
|
while True:
|
|
290
291
|
try:
|
|
291
|
-
run_line(input(f"{
|
|
292
|
+
run_line(input(f"{color_accent}{getpass.getuser()}{color_reset}@{os.uname()[1].rsplit('.', 1)[0]} {color_accent}{shorten_path(ENVIRONMENT.get('PWD', f'{Path('~').expanduser()}'))}{color_reset}> "))
|
|
292
293
|
except KeyboardInterrupt:
|
|
293
294
|
print()
|
|
294
295
|
continue
|
|
File without changes
|