From 5841e834f984838ef224ff04d8742c47a1e9b83a Mon Sep 17 00:00:00 2001 From: Aaron Heise <5148966+acehoss@users.noreply.github.com> Date: Fri, 17 Oct 2025 14:13:51 -0400 Subject: [PATCH 1/3] Update GitHub Actions workflow for Python publishing - Bumped `actions/checkout` to v4 for improved functionality. - Configured checkout to fetch only the current ref, disable tag fetching, and clean the workspace to prevent conflicts on self-hosted runners. - Simplified pytest command to run tests quietly. --- .github/workflows/python-publish.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 655e471..1a5db5c 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -24,9 +24,14 @@ jobs: runs-on: [self-hosted, linux] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: + # Ensure we only fetch the current ref, and avoid fetching tags to prevent + # 'would clobber existing tag' on self-hosted runners with cached repos fetch-depth: 1 + fetch-tags: false + clean: true + ref: ${{ github.ref }} - name: Set up Python 3.9 uses: actions/setup-python@v4 @@ -53,7 +58,7 @@ jobs: - name: Test with pytest - run: poetry run pytest -m "not skip_ci" tests + run: poetry run pytest -q - name: Build package From b114b190bd279a96c5d8bb0333e5bd5a73972070 Mon Sep 17 00:00:00 2001 From: Aaron Heise <5148966+acehoss@users.noreply.github.com> Date: Fri, 17 Oct 2025 14:18:22 -0400 Subject: [PATCH 2/3] Update GitHub Actions workflow for Python testing - Upgraded `actions/checkout` to v4 and configured it to fetch only the current ref, disable tag fetching, and clean the workspace. - Modified pytest command to run tests quietly for improved output clarity. --- .github/workflows/python-package.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 6c1e2eb..4da292a 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -22,9 +22,12 @@ jobs: runs-on: [self-hosted, linux] steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v4 with: fetch-depth: 1 + fetch-tags: false + clean: true + ref: ${{ github.ref }} - name: Set up Python 3.9 uses: actions/setup-python@v4 @@ -53,7 +56,7 @@ jobs: # run: poetry run black . --check - name: Test with pytest - run: poetry run pytest -m "not skip_ci" tests + run: poetry run pytest -q # - name: Vulnerability check # run: poetry run safety check From edb2562b35427ff94de363ecfeec7843a70e3b99 Mon Sep 17 00:00:00 2001 From: Aaron Heise <5148966+acehoss@users.noreply.github.com> Date: Fri, 17 Oct 2025 14:26:41 -0400 Subject: [PATCH 3/3] Enhance shell fallback mechanism and improve environment variable handling - Updated the listener to ensure a default shell of /bin/sh is used if the shell lookup fails or returns an empty value. - Modified the session to set a default TERM environment variable to "xterm" if none is provided, improving compatibility across different environments. --- rnsh/listener.py | 5 ++++- rnsh/session.py | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/rnsh/listener.py b/rnsh/listener.py index ed66d8e..5299429 100644 --- a/rnsh/listener.py +++ b/rnsh/listener.py @@ -158,7 +158,10 @@ async def listen(configdir, command, identitypath=None, service_name=None, verbo except Exception as e: log.error(f"Error looking up shell: {e}") log.info(f"Using {shell} for default command.") - _cmd = [shell] if shell else None + # Ensure a sane shell default. Fall back to /bin/sh if lookup fails. + if not shell or len(shell) == 0: + shell = "/bin/sh" + _cmd = [shell] else: log.info(f"Using command {shlex.join(_cmd)}") diff --git a/rnsh/session.py b/rnsh/session.py index 77628bb..4268a20 100644 --- a/rnsh/session.py +++ b/rnsh/session.py @@ -311,7 +311,7 @@ def stderr(data: bytes): try: self.process = process.CallbackSubprocess(argv=self.cmdline, - env={"TERM": self.term or os.environ.get("TERM", None), + env={"TERM": self.term or os.environ.get("TERM") or "xterm", "RNS_REMOTE_IDENTITY": (RNS.prettyhexrep(self.remote_identity.hash) if self.remote_identity and self.remote_identity.hash else "")}, loop=self.loop,