nercone-shell 0.2.7__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.3.0/PKG-INFO +101 -0
- nercone_shell-0.3.0/README.md +87 -0
- {nercone_shell-0.2.7 → nercone_shell-0.3.0}/pyproject.toml +1 -1
- {nercone_shell-0.2.7 → nercone_shell-0.3.0}/src/nercone_shell/__main__.py +22 -14
- nercone_shell-0.2.7/PKG-INFO +0 -62
- nercone_shell-0.2.7/README.md +0 -48
- {nercone_shell-0.2.7 → nercone_shell-0.3.0}/src/nercone_shell/__init__.py +0 -0
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
|
+
Name: nercone-shell
|
|
3
|
+
Version: 0.3.0
|
|
4
|
+
Summary: Modern shell for Developers
|
|
5
|
+
Author: Nercone
|
|
6
|
+
Author-email: Nercone <nercone@diamondgotcat.net>
|
|
7
|
+
License: MIT
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Requires-Dist: nercone-modern
|
|
12
|
+
Requires-Python: >=3.8
|
|
13
|
+
Description-Content-Type: text/markdown
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
<img width="1710" alt="Screenshot" src="https://github.com/user-attachments/assets/a717ebd3-c9d4-447c-86a5-7d33eea9c028" />
|
|
17
|
+
|
|
18
|
+
# Nersh (Nercone Shell)
|
|
19
|
+
Modern shell for Developers
|
|
20
|
+
|
|
21
|
+
## Requiments
|
|
22
|
+
- CPython 3.9+
|
|
23
|
+
- `uv` [PyPI↗︎](https://pypi.org/project/uv/) or `pip3` [PyPI↗︎](https://pypi.org/project/pip/)
|
|
24
|
+
- `nercone-modern` [PyPI↗︎](https://pypi.org/project/nercone-modern/)
|
|
25
|
+
|
|
26
|
+
## Installation
|
|
27
|
+
|
|
28
|
+
### using uv (recommended)
|
|
29
|
+
```
|
|
30
|
+
uv tool install nercone-shell
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### using pip3
|
|
34
|
+
|
|
35
|
+
**System Python:**
|
|
36
|
+
```
|
|
37
|
+
pip3 install nercone-shell --break-system-packages
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
**Venv Python:**
|
|
41
|
+
```
|
|
42
|
+
pip3 install nercone-shell
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Update
|
|
46
|
+
|
|
47
|
+
### using uv (recommended)
|
|
48
|
+
```
|
|
49
|
+
uv tool install nercone-shell --upgrade
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### using pip3
|
|
53
|
+
|
|
54
|
+
**System Python:**
|
|
55
|
+
```
|
|
56
|
+
pip3 install nercone-shell --upgrade --break-system-packages
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
**Venv Python:**
|
|
60
|
+
```
|
|
61
|
+
pip3 install nercone-shell --upgrade
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Usage
|
|
65
|
+
```
|
|
66
|
+
nersh
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Configuration
|
|
70
|
+
The configuration file is usually located at `~/.nercone/nercone-shell/config.json`.
|
|
71
|
+
If the file does not exist when Nersh starts, it will be automatically created.
|
|
72
|
+
|
|
73
|
+
The following is the default configuration file:
|
|
74
|
+
```
|
|
75
|
+
{
|
|
76
|
+
"customization": {
|
|
77
|
+
"show_version": true,
|
|
78
|
+
"accent_color": "blue",
|
|
79
|
+
"override_env": {
|
|
80
|
+
"SHELL": "None"
|
|
81
|
+
},
|
|
82
|
+
"autoruns": [
|
|
83
|
+
"<path to home directory>/.nercone/nercone-shell/autostart.sh"
|
|
84
|
+
]
|
|
85
|
+
},
|
|
86
|
+
"compatibility": {
|
|
87
|
+
"report_invisible_characters": false
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Customization
|
|
93
|
+
These settings customize the behavior of Nersh.
|
|
94
|
+
- `show_version`: Sets whether to display version information at startup.
|
|
95
|
+
- `accent_color`: Accent color used for prompts etc.
|
|
96
|
+
- `override_env`: Sets the environment variables you want to set at startup in dictionary format.
|
|
97
|
+
- `autoruns`: Sets the shell scripts you want to run at startup in array format.
|
|
98
|
+
|
|
99
|
+
### Compatibility
|
|
100
|
+
This setting allows Nersh to function properly in special environments.
|
|
101
|
+
- `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).
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
|
|
2
|
+
<img width="1710" alt="Screenshot" src="https://github.com/user-attachments/assets/a717ebd3-c9d4-447c-86a5-7d33eea9c028" />
|
|
3
|
+
|
|
4
|
+
# Nersh (Nercone Shell)
|
|
5
|
+
Modern shell for Developers
|
|
6
|
+
|
|
7
|
+
## Requiments
|
|
8
|
+
- CPython 3.9+
|
|
9
|
+
- `uv` [PyPI↗︎](https://pypi.org/project/uv/) or `pip3` [PyPI↗︎](https://pypi.org/project/pip/)
|
|
10
|
+
- `nercone-modern` [PyPI↗︎](https://pypi.org/project/nercone-modern/)
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
### using uv (recommended)
|
|
15
|
+
```
|
|
16
|
+
uv tool install nercone-shell
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### using pip3
|
|
20
|
+
|
|
21
|
+
**System Python:**
|
|
22
|
+
```
|
|
23
|
+
pip3 install nercone-shell --break-system-packages
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
**Venv Python:**
|
|
27
|
+
```
|
|
28
|
+
pip3 install nercone-shell
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Update
|
|
32
|
+
|
|
33
|
+
### using uv (recommended)
|
|
34
|
+
```
|
|
35
|
+
uv tool install nercone-shell --upgrade
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### using pip3
|
|
39
|
+
|
|
40
|
+
**System Python:**
|
|
41
|
+
```
|
|
42
|
+
pip3 install nercone-shell --upgrade --break-system-packages
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
**Venv Python:**
|
|
46
|
+
```
|
|
47
|
+
pip3 install nercone-shell --upgrade
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Usage
|
|
51
|
+
```
|
|
52
|
+
nersh
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Configuration
|
|
56
|
+
The configuration file is usually located at `~/.nercone/nercone-shell/config.json`.
|
|
57
|
+
If the file does not exist when Nersh starts, it will be automatically created.
|
|
58
|
+
|
|
59
|
+
The following is the default configuration file:
|
|
60
|
+
```
|
|
61
|
+
{
|
|
62
|
+
"customization": {
|
|
63
|
+
"show_version": true,
|
|
64
|
+
"accent_color": "blue",
|
|
65
|
+
"override_env": {
|
|
66
|
+
"SHELL": "None"
|
|
67
|
+
},
|
|
68
|
+
"autoruns": [
|
|
69
|
+
"<path to home directory>/.nercone/nercone-shell/autostart.sh"
|
|
70
|
+
]
|
|
71
|
+
},
|
|
72
|
+
"compatibility": {
|
|
73
|
+
"report_invisible_characters": false
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Customization
|
|
79
|
+
These settings customize the behavior of Nersh.
|
|
80
|
+
- `show_version`: Sets whether to display version information at startup.
|
|
81
|
+
- `accent_color`: Accent color used for prompts etc.
|
|
82
|
+
- `override_env`: Sets the environment variables you want to set at startup in dictionary format.
|
|
83
|
+
- `autoruns`: Sets the shell scripts you want to run at startup in array format.
|
|
84
|
+
|
|
85
|
+
### Compatibility
|
|
86
|
+
This setting allows Nersh to function properly in special environments.
|
|
87
|
+
- `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).
|
|
@@ -30,13 +30,19 @@ NERSH_HISTORY_PATH = Path(os.environ.get("NERSH_HISTORY_PATH", str(Path(NERSH_PA
|
|
|
30
30
|
NERSH_CONFIG: dict = {}
|
|
31
31
|
NERSH_CONFIG_PATH = Path(os.environ.get("NERSH_CONFIG_PATH", str(Path(NERSH_PATH, "config.json"))))
|
|
32
32
|
NERSH_CONFIG_DEFAULT: dict = {
|
|
33
|
-
"
|
|
34
|
-
|
|
35
|
-
"
|
|
33
|
+
"customization": {
|
|
34
|
+
"show_version": True,
|
|
35
|
+
"accent_color": "blue",
|
|
36
|
+
"override_env": {
|
|
37
|
+
"SHELL": f"{shutil.which('nersh')}"
|
|
38
|
+
},
|
|
39
|
+
"autoruns": [
|
|
40
|
+
f"{Path(NERSH_PATH, 'autostart.sh')}"
|
|
41
|
+
]
|
|
36
42
|
},
|
|
37
|
-
"
|
|
38
|
-
|
|
39
|
-
|
|
43
|
+
"compatibility": {
|
|
44
|
+
"report_invisible_characters": False
|
|
45
|
+
}
|
|
40
46
|
}
|
|
41
47
|
|
|
42
48
|
class NershCompleter:
|
|
@@ -158,8 +164,10 @@ def reset():
|
|
|
158
164
|
def reload():
|
|
159
165
|
global ENVIRONMENT
|
|
160
166
|
load_config()
|
|
167
|
+
pwd = ENVIRONMENT.get("PWD")
|
|
161
168
|
ENVIRONMENT |= os.environ
|
|
162
|
-
ENVIRONMENT |=
|
|
169
|
+
ENVIRONMENT |= {"PWD": pwd}
|
|
170
|
+
ENVIRONMENT |= NERSH_CONFIG.get("customization", {}).get("override_env", {})
|
|
163
171
|
|
|
164
172
|
def load_config() -> dict:
|
|
165
173
|
global NERSH_CONFIG
|
|
@@ -169,7 +177,7 @@ def load_config() -> dict:
|
|
|
169
177
|
f.write(json.dumps(NERSH_CONFIG_DEFAULT, indent=4) + "\n")
|
|
170
178
|
with NERSH_CONFIG_PATH.open("r") as f:
|
|
171
179
|
NERSH_CONFIG |= json.loads(f.read())
|
|
172
|
-
for p in NERSH_CONFIG.get("autoruns", []):
|
|
180
|
+
for p in NERSH_CONFIG.get("customization", {}).get("autoruns", []):
|
|
173
181
|
if not Path(p).is_file():
|
|
174
182
|
with Path(p).open("w") as f:
|
|
175
183
|
f.write("\n")
|
|
@@ -261,9 +269,9 @@ def main() -> int:
|
|
|
261
269
|
else:
|
|
262
270
|
readline.parse_and_bind("tab: complete")
|
|
263
271
|
readline.set_completer_delims(' \t\n;')
|
|
264
|
-
if NERSH_CONFIG.get("show_version", True):
|
|
272
|
+
if NERSH_CONFIG.get("customization", {}).get("show_version", True):
|
|
265
273
|
show_version()
|
|
266
|
-
for p in NERSH_CONFIG.get("autoruns", []):
|
|
274
|
+
for p in NERSH_CONFIG.get("customization", {}).get("autoruns", []):
|
|
267
275
|
if Path(p).is_file():
|
|
268
276
|
with Path(p).open("r") as f:
|
|
269
277
|
run_script(f.read())
|
|
@@ -275,13 +283,13 @@ def main() -> int:
|
|
|
275
283
|
run_script(NERSH_AUTORUN)
|
|
276
284
|
if NERSH_HISTORY_PATH.is_file():
|
|
277
285
|
readline.read_history_file(NERSH_HISTORY_PATH)
|
|
278
|
-
RL_PROMPT_START_IGNORE =
|
|
279
|
-
RL_PROMPT_END_IGNORE =
|
|
280
|
-
|
|
286
|
+
RL_PROMPT_START_IGNORE = "\001" if NERSH_CONFIG.get("compatibility", {}).get("report_invisible_characters", False) else ""
|
|
287
|
+
RL_PROMPT_END_IGNORE = "\002" if NERSH_CONFIG.get("compatibility", {}).get("report_invisible_characters", False) else ""
|
|
288
|
+
color_accent = f"{RL_PROMPT_START_IGNORE}{NERSH_CONFIG.get('customization', {}).get('accent_color', 'blue')}{RL_PROMPT_END_IGNORE}"
|
|
281
289
|
color_reset = f"{RL_PROMPT_START_IGNORE}{ModernColor.color('reset')}{RL_PROMPT_END_IGNORE}"
|
|
282
290
|
while True:
|
|
283
291
|
try:
|
|
284
|
-
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}> "))
|
|
285
293
|
except KeyboardInterrupt:
|
|
286
294
|
print()
|
|
287
295
|
continue
|
nercone_shell-0.2.7/PKG-INFO
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.3
|
|
2
|
-
Name: nercone-shell
|
|
3
|
-
Version: 0.2.7
|
|
4
|
-
Summary: Modern shell for Developers
|
|
5
|
-
Author: Nercone
|
|
6
|
-
Author-email: Nercone <nercone@diamondgotcat.net>
|
|
7
|
-
License: MIT
|
|
8
|
-
Classifier: Programming Language :: Python :: 3
|
|
9
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
-
Classifier: Operating System :: OS Independent
|
|
11
|
-
Requires-Dist: nercone-modern
|
|
12
|
-
Requires-Python: >=3.8
|
|
13
|
-
Description-Content-Type: text/markdown
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
<img width="1710" alt="Screenshot" src="https://github.com/user-attachments/assets/a717ebd3-c9d4-447c-86a5-7d33eea9c028" />
|
|
17
|
-
|
|
18
|
-
# Nersh (Nercone Shell)
|
|
19
|
-
Modern shell for Developers
|
|
20
|
-
|
|
21
|
-
## Requiments
|
|
22
|
-
- CPython 3.9+
|
|
23
|
-
- `uv` [PyPI↗︎](https://pypi.org/project/uv/) or `pip3` [PyPI↗︎](https://pypi.org/project/pip/)
|
|
24
|
-
- `nercone-modern` [PyPI↗︎](https://pypi.org/project/nercone-modern/)
|
|
25
|
-
|
|
26
|
-
## Installation
|
|
27
|
-
|
|
28
|
-
### using uv (recommended)
|
|
29
|
-
```
|
|
30
|
-
uv tool install nercone-shell
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
### using pip3
|
|
34
|
-
|
|
35
|
-
**System Python:**
|
|
36
|
-
```
|
|
37
|
-
pip3 install nercone-shell --break-system-packages
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
**Venv Python:**
|
|
41
|
-
```
|
|
42
|
-
pip3 install nercone-shell
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
## Update
|
|
46
|
-
|
|
47
|
-
### using uv (recommended)
|
|
48
|
-
```
|
|
49
|
-
uv tool install nercone-shell --upgrade
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
### using pip3
|
|
53
|
-
|
|
54
|
-
**System Python:**
|
|
55
|
-
```
|
|
56
|
-
pip3 install nercone-shell --upgrade --break-system-packages
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
**Venv Python:**
|
|
60
|
-
```
|
|
61
|
-
pip3 install nercone-shell --upgrade
|
|
62
|
-
```
|
nercone_shell-0.2.7/README.md
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
<img width="1710" alt="Screenshot" src="https://github.com/user-attachments/assets/a717ebd3-c9d4-447c-86a5-7d33eea9c028" />
|
|
3
|
-
|
|
4
|
-
# Nersh (Nercone Shell)
|
|
5
|
-
Modern shell for Developers
|
|
6
|
-
|
|
7
|
-
## Requiments
|
|
8
|
-
- CPython 3.9+
|
|
9
|
-
- `uv` [PyPI↗︎](https://pypi.org/project/uv/) or `pip3` [PyPI↗︎](https://pypi.org/project/pip/)
|
|
10
|
-
- `nercone-modern` [PyPI↗︎](https://pypi.org/project/nercone-modern/)
|
|
11
|
-
|
|
12
|
-
## Installation
|
|
13
|
-
|
|
14
|
-
### using uv (recommended)
|
|
15
|
-
```
|
|
16
|
-
uv tool install nercone-shell
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
### using pip3
|
|
20
|
-
|
|
21
|
-
**System Python:**
|
|
22
|
-
```
|
|
23
|
-
pip3 install nercone-shell --break-system-packages
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
**Venv Python:**
|
|
27
|
-
```
|
|
28
|
-
pip3 install nercone-shell
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
## Update
|
|
32
|
-
|
|
33
|
-
### using uv (recommended)
|
|
34
|
-
```
|
|
35
|
-
uv tool install nercone-shell --upgrade
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
### using pip3
|
|
39
|
-
|
|
40
|
-
**System Python:**
|
|
41
|
-
```
|
|
42
|
-
pip3 install nercone-shell --upgrade --break-system-packages
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
**Venv Python:**
|
|
46
|
-
```
|
|
47
|
-
pip3 install nercone-shell --upgrade
|
|
48
|
-
```
|
|
File without changes
|