xmyshell 0.2.19__tar.gz → 0.2.20__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.
- {xmyshell-0.2.19/xmyshell.egg-info → xmyshell-0.2.20}/PKG-INFO +11 -2
- {xmyshell-0.2.19 → xmyshell-0.2.20}/README.md +10 -1
- {xmyshell-0.2.19 → xmyshell-0.2.20}/pyproject.toml +1 -1
- {xmyshell-0.2.19 → xmyshell-0.2.20}/xmyshell/kernel.py +1 -1
- {xmyshell-0.2.19 → xmyshell-0.2.20}/xmyshell/keybindings.py +17 -0
- {xmyshell-0.2.19 → xmyshell-0.2.20}/xmyshell/main.py +5 -0
- {xmyshell-0.2.19 → xmyshell-0.2.20}/xmyshell/meta.py +1 -0
- {xmyshell-0.2.19 → xmyshell-0.2.20/xmyshell.egg-info}/PKG-INFO +11 -2
- {xmyshell-0.2.19 → xmyshell-0.2.20}/LICENSE +0 -0
- {xmyshell-0.2.19 → xmyshell-0.2.20}/setup.cfg +0 -0
- {xmyshell-0.2.19 → xmyshell-0.2.20}/xmyshell/__init__.py +0 -0
- {xmyshell-0.2.19 → xmyshell-0.2.20}/xmyshell/__main__.py +0 -0
- {xmyshell-0.2.19 → xmyshell-0.2.20}/xmyshell/completer.py +0 -0
- {xmyshell-0.2.19 → xmyshell-0.2.20}/xmyshell/data/commands.json +0 -0
- {xmyshell-0.2.19 → xmyshell-0.2.20}/xmyshell/environment.py +0 -0
- {xmyshell-0.2.19 → xmyshell-0.2.20}/xmyshell/init.py +0 -0
- {xmyshell-0.2.19 → xmyshell-0.2.20}/xmyshell/injection.py +0 -0
- {xmyshell-0.2.19 → xmyshell-0.2.20}/xmyshell/stubs/__init__.py +0 -0
- {xmyshell-0.2.19 → xmyshell-0.2.20}/xmyshell/stubs/__init__.pyi +0 -0
- {xmyshell-0.2.19 → xmyshell-0.2.20}/xmyshell/stubs/py.typed +0 -0
- {xmyshell-0.2.19 → xmyshell-0.2.20}/xmyshell/themes.py +0 -0
- {xmyshell-0.2.19 → xmyshell-0.2.20}/xmyshell/update.py +0 -0
- {xmyshell-0.2.19 → xmyshell-0.2.20}/xmyshell/utils.py +0 -0
- {xmyshell-0.2.19 → xmyshell-0.2.20}/xmyshell.egg-info/SOURCES.txt +0 -0
- {xmyshell-0.2.19 → xmyshell-0.2.20}/xmyshell.egg-info/dependency_links.txt +0 -0
- {xmyshell-0.2.19 → xmyshell-0.2.20}/xmyshell.egg-info/entry_points.txt +0 -0
- {xmyshell-0.2.19 → xmyshell-0.2.20}/xmyshell.egg-info/requires.txt +0 -0
- {xmyshell-0.2.19 → xmyshell-0.2.20}/xmyshell.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: xmyshell
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.20
|
|
4
4
|
Summary: XmyShell is a shell-like tool built on top of prompt_toolkit which provides a persistent Python runtime.
|
|
5
5
|
Requires-Python: >=3.12
|
|
6
6
|
Description-Content-Type: text/markdown
|
|
@@ -126,8 +126,16 @@ Here is an example (though there are other ways to do this, it is just an exampl
|
|
|
126
126
|
❯ pip install {cat("requirements.txt").splitlines()}
|
|
127
127
|
```
|
|
128
128
|
|
|
129
|
+
- Multiline input with ending `\`.
|
|
130
|
+
```
|
|
131
|
+
[~] $ pyexec
|
|
132
|
+
......
|
|
133
|
+
......def foo():
|
|
134
|
+
...... print("Hello!")
|
|
135
|
+
[~] $ pyexec foo()
|
|
136
|
+
Hello!
|
|
137
|
+
```
|
|
129
138
|
|
|
130
|
-
- Syntax highlighting via `prompt_toolkit`
|
|
131
139
|
- Powerful auto-completion, history search, and automatic bracket/quote pairing
|
|
132
140
|
- Startup configuration: `~/.xmyshell/config.py` loaded at launch
|
|
133
141
|
- Cross-platform (Windows, Linux, macOS)
|
|
@@ -190,6 +198,7 @@ The path of config file.
|
|
|
190
198
|
- `Ctrl+R` -> Reverse incremental searching (history).
|
|
191
199
|
- `Ctrl+Z` -> Undo.
|
|
192
200
|
- `Ctrl+Y` -> Redo.
|
|
201
|
+
- `Ctrl+G` -> Hide completions.
|
|
193
202
|
- `Ctrl+D` -> Exit XmyShell.
|
|
194
203
|
- Auto bracket/parenthesis/quote pairing
|
|
195
204
|
|
|
@@ -116,8 +116,16 @@ Here is an example (though there are other ways to do this, it is just an exampl
|
|
|
116
116
|
❯ pip install {cat("requirements.txt").splitlines()}
|
|
117
117
|
```
|
|
118
118
|
|
|
119
|
+
- Multiline input with ending `\`.
|
|
120
|
+
```
|
|
121
|
+
[~] $ pyexec
|
|
122
|
+
......
|
|
123
|
+
......def foo():
|
|
124
|
+
...... print("Hello!")
|
|
125
|
+
[~] $ pyexec foo()
|
|
126
|
+
Hello!
|
|
127
|
+
```
|
|
119
128
|
|
|
120
|
-
- Syntax highlighting via `prompt_toolkit`
|
|
121
129
|
- Powerful auto-completion, history search, and automatic bracket/quote pairing
|
|
122
130
|
- Startup configuration: `~/.xmyshell/config.py` loaded at launch
|
|
123
131
|
- Cross-platform (Windows, Linux, macOS)
|
|
@@ -180,6 +188,7 @@ The path of config file.
|
|
|
180
188
|
- `Ctrl+R` -> Reverse incremental searching (history).
|
|
181
189
|
- `Ctrl+Z` -> Undo.
|
|
182
190
|
- `Ctrl+Y` -> Redo.
|
|
191
|
+
- `Ctrl+G` -> Hide completions.
|
|
183
192
|
- `Ctrl+D` -> Exit XmyShell.
|
|
184
193
|
- Auto bracket/parenthesis/quote pairing
|
|
185
194
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import time
|
|
2
2
|
from prompt_toolkit.buffer import Buffer
|
|
3
|
+
from prompt_toolkit.filters import has_completions
|
|
3
4
|
from prompt_toolkit.key_binding import KeyBindings, KeyPressEvent
|
|
4
5
|
from prompt_toolkit.selection import SelectionState
|
|
5
6
|
from prompt_toolkit.keys import Keys
|
|
@@ -370,3 +371,19 @@ def _(event: KeyPressEvent) -> None:
|
|
|
370
371
|
text = buffer.complete_state.current_completion.text
|
|
371
372
|
buffer.complete_state.current_completion.text = text.rstrip()
|
|
372
373
|
buffer.apply_completion(buffer.complete_state.current_completion)
|
|
374
|
+
|
|
375
|
+
@bindings.add(Keys.Enter)
|
|
376
|
+
def handle_enter(event):
|
|
377
|
+
buffer = event.current_buffer
|
|
378
|
+
current_line = buffer.document.current_line_before_cursor
|
|
379
|
+
|
|
380
|
+
if current_line.rstrip().endswith("\\"):
|
|
381
|
+
stripped = current_line.rstrip()
|
|
382
|
+
buffer.delete_before_cursor(count=len(current_line) - len(stripped) + 1)
|
|
383
|
+
buffer.insert_text("\n")
|
|
384
|
+
else:
|
|
385
|
+
buffer.validate_and_handle()
|
|
386
|
+
|
|
387
|
+
@bindings.add("escape", filter=has_completions, eager=True)
|
|
388
|
+
def cancel_completion(event):
|
|
389
|
+
event.current_buffer.cancel_completion()
|
|
@@ -21,6 +21,9 @@ from .init import xmyshell_init
|
|
|
21
21
|
from .kernel import pyeval, xmyshell
|
|
22
22
|
from .injection import inject
|
|
23
23
|
|
|
24
|
+
def _continuation(width, line_number, is_soft_wrap):
|
|
25
|
+
return HTML("<style fg='ansidarkgray'>" + '.' * width + "</style>")
|
|
26
|
+
|
|
24
27
|
def xmyshell_main() -> None:
|
|
25
28
|
xmyshell_init()
|
|
26
29
|
|
|
@@ -34,6 +37,8 @@ def xmyshell_main() -> None:
|
|
|
34
37
|
complete_in_thread=True,
|
|
35
38
|
complete_while_typing=True,
|
|
36
39
|
key_bindings=bindings,
|
|
40
|
+
multiline=True,
|
|
41
|
+
prompt_continuation=_continuation,
|
|
37
42
|
)
|
|
38
43
|
session.default_buffer.on_cursor_position_changed += on_cursor_position_changed
|
|
39
44
|
session.default_buffer.on_text_changed += on_text_changed
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: xmyshell
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.20
|
|
4
4
|
Summary: XmyShell is a shell-like tool built on top of prompt_toolkit which provides a persistent Python runtime.
|
|
5
5
|
Requires-Python: >=3.12
|
|
6
6
|
Description-Content-Type: text/markdown
|
|
@@ -126,8 +126,16 @@ Here is an example (though there are other ways to do this, it is just an exampl
|
|
|
126
126
|
❯ pip install {cat("requirements.txt").splitlines()}
|
|
127
127
|
```
|
|
128
128
|
|
|
129
|
+
- Multiline input with ending `\`.
|
|
130
|
+
```
|
|
131
|
+
[~] $ pyexec
|
|
132
|
+
......
|
|
133
|
+
......def foo():
|
|
134
|
+
...... print("Hello!")
|
|
135
|
+
[~] $ pyexec foo()
|
|
136
|
+
Hello!
|
|
137
|
+
```
|
|
129
138
|
|
|
130
|
-
- Syntax highlighting via `prompt_toolkit`
|
|
131
139
|
- Powerful auto-completion, history search, and automatic bracket/quote pairing
|
|
132
140
|
- Startup configuration: `~/.xmyshell/config.py` loaded at launch
|
|
133
141
|
- Cross-platform (Windows, Linux, macOS)
|
|
@@ -190,6 +198,7 @@ The path of config file.
|
|
|
190
198
|
- `Ctrl+R` -> Reverse incremental searching (history).
|
|
191
199
|
- `Ctrl+Z` -> Undo.
|
|
192
200
|
- `Ctrl+Y` -> Redo.
|
|
201
|
+
- `Ctrl+G` -> Hide completions.
|
|
193
202
|
- `Ctrl+D` -> Exit XmyShell.
|
|
194
203
|
- Auto bracket/parenthesis/quote pairing
|
|
195
204
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|