akashcli 4.6.1__tar.gz → 4.6.2__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.
- {akashcli-4.6.1 → akashcli-4.6.2}/PKG-INFO +1 -1
- {akashcli-4.6.1 → akashcli-4.6.2}/akashcli/relay.py +36 -9
- {akashcli-4.6.1 → akashcli-4.6.2}/akashcli.egg-info/PKG-INFO +1 -1
- {akashcli-4.6.1 → akashcli-4.6.2}/pyproject.toml +1 -1
- {akashcli-4.6.1 → akashcli-4.6.2}/README.md +0 -0
- {akashcli-4.6.1 → akashcli-4.6.2}/akashcli/__init__.py +0 -0
- {akashcli-4.6.1 → akashcli-4.6.2}/akashcli/_net.py +0 -0
- {akashcli-4.6.1 → akashcli-4.6.2}/akashcli/auth.py +0 -0
- {akashcli-4.6.1 → akashcli-4.6.2}/akashcli/cli.py +0 -0
- {akashcli-4.6.1 → akashcli-4.6.2}/akashcli/client.py +0 -0
- {akashcli-4.6.1 → akashcli-4.6.2}/akashcli/config.py +0 -0
- {akashcli-4.6.1 → akashcli-4.6.2}/akashcli/crypto.py +0 -0
- {akashcli-4.6.1 → akashcli-4.6.2}/akashcli/env_manager.py +0 -0
- {akashcli-4.6.1 → akashcli-4.6.2}/akashcli/exceptions.py +0 -0
- {akashcli-4.6.1 → akashcli-4.6.2}/akashcli/exec.py +0 -0
- {akashcli-4.6.1 → akashcli-4.6.2}/akashcli/integrity.py +0 -0
- {akashcli-4.6.1 → akashcli-4.6.2}/akashcli/logger.py +0 -0
- {akashcli-4.6.1 → akashcli-4.6.2}/akashcli/models.py +0 -0
- {akashcli-4.6.1 → akashcli-4.6.2}/akashcli/p2p.py +0 -0
- {akashcli-4.6.1 → akashcli-4.6.2}/akashcli/packages.py +0 -0
- {akashcli-4.6.1 → akashcli-4.6.2}/akashcli/restore.py +0 -0
- {akashcli-4.6.1 → akashcli-4.6.2}/akashcli/snapshot_crypto.py +0 -0
- {akashcli-4.6.1 → akashcli-4.6.2}/akashcli/storage.py +0 -0
- {akashcli-4.6.1 → akashcli-4.6.2}/akashcli/terminal.py +0 -0
- {akashcli-4.6.1 → akashcli-4.6.2}/akashcli/uploader.py +0 -0
- {akashcli-4.6.1 → akashcli-4.6.2}/akashcli/utils.py +0 -0
- {akashcli-4.6.1 → akashcli-4.6.2}/akashcli.egg-info/SOURCES.txt +0 -0
- {akashcli-4.6.1 → akashcli-4.6.2}/akashcli.egg-info/dependency_links.txt +0 -0
- {akashcli-4.6.1 → akashcli-4.6.2}/akashcli.egg-info/entry_points.txt +0 -0
- {akashcli-4.6.1 → akashcli-4.6.2}/akashcli.egg-info/requires.txt +0 -0
- {akashcli-4.6.1 → akashcli-4.6.2}/akashcli.egg-info/top_level.txt +0 -0
- {akashcli-4.6.1 → akashcli-4.6.2}/setup.cfg +0 -0
|
@@ -211,30 +211,51 @@ def _handle_pty(ws, frame: dict) -> None:
|
|
|
211
211
|
|
|
212
212
|
def _child_setup():
|
|
213
213
|
"""Run inside the child process before exec.
|
|
214
|
-
start_new_session=True already
|
|
215
|
-
|
|
214
|
+
start_new_session=True already called setsid(); claim the slave PTY
|
|
215
|
+
as controlling terminal so bash gets full job control when possible."""
|
|
216
216
|
try:
|
|
217
217
|
fcntl.ioctl(0, termios.TIOCSCTTY, 0)
|
|
218
218
|
except Exception:
|
|
219
219
|
pass
|
|
220
220
|
|
|
221
221
|
import subprocess as _sp
|
|
222
|
+
import tempfile as _tmp
|
|
223
|
+
|
|
222
224
|
shell = command or os.environ.get("SHELL", "/bin/bash")
|
|
223
225
|
|
|
224
|
-
#
|
|
225
|
-
#
|
|
226
|
-
#
|
|
226
|
+
# On Android non-root, TIOCSCTTY is blocked by SELinux so bash prints:
|
|
227
|
+
# "cannot set terminal process group … no job control"
|
|
228
|
+
# Fix: launch bash with --rcfile pointing to a temp file that sources
|
|
229
|
+
# ~/.bashrc then runs `set +m` (disable job-control monitoring).
|
|
230
|
+
# This silences the warning while keeping the shell fully interactive.
|
|
231
|
+
_env = {**os.environ,
|
|
232
|
+
"TERM": "xterm-256color",
|
|
233
|
+
"COLUMNS": str(cols), "LINES": str(rows)}
|
|
234
|
+
_bash_env_file = None
|
|
235
|
+
_shell_args = [shell]
|
|
236
|
+
if "bash" in shell.lower():
|
|
237
|
+
try:
|
|
238
|
+
_fd, _bash_env_file = _tmp.mkstemp(prefix=".akash_rc_", suffix=".sh")
|
|
239
|
+
# Source ~/.bashrc if it exists, then disable job-control monitoring
|
|
240
|
+
_rc = (
|
|
241
|
+
b'[ -f ~/.bashrc ] && . ~/.bashrc\n'
|
|
242
|
+
b'set +m\n'
|
|
243
|
+
)
|
|
244
|
+
os.write(_fd, _rc)
|
|
245
|
+
os.close(_fd)
|
|
246
|
+
_shell_args = [shell, "--rcfile", _bash_env_file]
|
|
247
|
+
except Exception:
|
|
248
|
+
_bash_env_file = None
|
|
249
|
+
|
|
227
250
|
try:
|
|
228
251
|
proc = _sp.Popen(
|
|
229
|
-
|
|
252
|
+
_shell_args,
|
|
230
253
|
stdin=slave_fd, stdout=slave_fd, stderr=slave_fd,
|
|
231
254
|
close_fds=True,
|
|
232
255
|
start_new_session=True,
|
|
233
256
|
preexec_fn=_child_setup,
|
|
234
257
|
cwd=os.path.expanduser("~"),
|
|
235
|
-
env=
|
|
236
|
-
"TERM": "xterm-256color",
|
|
237
|
-
"COLUMNS": str(cols), "LINES": str(rows)},
|
|
258
|
+
env=_env,
|
|
238
259
|
)
|
|
239
260
|
except Exception as e:
|
|
240
261
|
try:
|
|
@@ -326,6 +347,12 @@ def _handle_pty(ws, frame: dict) -> None:
|
|
|
326
347
|
os.close(master_fd)
|
|
327
348
|
except Exception:
|
|
328
349
|
pass
|
|
350
|
+
# Clean up the BASH_ENV temp file if we created one
|
|
351
|
+
if _bash_env_file:
|
|
352
|
+
try:
|
|
353
|
+
os.unlink(_bash_env_file)
|
|
354
|
+
except Exception:
|
|
355
|
+
pass
|
|
329
356
|
try:
|
|
330
357
|
ws.send(json.dumps({"type": "exit", "code": proc.returncode or 0}))
|
|
331
358
|
except Exception:
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|