ls -1 exits 1 with empty output for readable directory

Open
#266 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
58/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
go
Domain
cli

Research direction

Start at the rshell ls builtin entry point and reproduce the exact ls -1 <container-log-directory> 2>/dev/null command from QA run run-20260519T170100Z-ls. Compare its exit status and newline-delimited stdout with bash/coreutils. Done means a readable directory with entries produces the listing and exits 0.

Written by the indexing model from the issue text.

Description

QA
Describe the bug

During pshim QA for the ls builtin, rshell returned exit code 1 and produced no listing for ls -1 on an existing readable container log directory. The oracle shell returned exit code 0 and listed the directory entries.

Current rshell source documents and registers ls -1 as a supported flag, so this does not appear to be an unsupported-flag case.

Steps to reproduce
  1. Run rshell against an existing readable directory with entries.
  2. Execute:
    ls -1 <container-log-directory> 2>/dev/null
    
  3. Compare the result with the same command under bash/coreutils.
Expected behavior

ls -1 exits 0 and prints one directory entry per line.

Actual behavior

rshell exits 1 and prints no stdout.

In QA run run-20260519T170100Z-ls, this occurred in 49 scenarios for command shape:

ls -1 <container-log-directory> 2>/dev/null

Comparison:

  • Rshell exit code: 1
  • Oracle exit code: 0
  • Rshell stdout: empty
  • Oracle stdout: newline-delimited filenames
  • Stderr was redirected to /dev/null, so the underlying rshell error text was intentionally suppressed.
Environment
  • OS: Linux, KIND node
  • Go version: unknown
  • rshell version/commit: unknown
Dominant language
Go
Stars
31
Forks
3
Avg merge
1d 12h
Merged PRs (30d)
11

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from DataDog/rshell

All issues in DataDog/rshell

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.