Skip to content

Conversation

@skepppy
Copy link
Contributor

@skepppy skepppy commented Jan 23, 2026

Calling ls -l on a file currently just prints that the provided file is indeed a file. This change makes ls -l print the file information, just like you would see when calling ls -l on the directory the file is in. Also, this change makes ls respect the NO_COLOR environment variable, which wasn't the case before.

Print file information when calling ls -l on a file and also take into account the NO_COLOR environment variable for ls output.

Closes #1514 and #1044.

@codspeed-hq
Copy link

codspeed-hq bot commented Jan 23, 2026

Merging this PR will not alter performance

✅ 11 untouched benchmarks


Comparing skepppy:fix/target-shell-ls (117c1aa) with main (ab0db26)

Open in CodSpeed

@skepppy skepppy force-pushed the fix/target-shell-ls branch from f29000b to 117c1aa Compare January 23, 2026 16:58
@codecov
Copy link

codecov bot commented Jan 23, 2026

Codecov Report

❌ Patch coverage is 80.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 80.77%. Comparing base (ab0db26) to head (117c1aa).

Files with missing lines Patch % Lines
dissect/target/tools/shell.py 80.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1515      +/-   ##
==========================================
+ Coverage   80.75%   80.77%   +0.02%     
==========================================
  Files         396      396              
  Lines       34744    34745       +1     
==========================================
+ Hits        28057    28065       +8     
+ Misses       6687     6680       -7     
Flag Coverage Δ
unittests 80.77% <80.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@skepppy skepppy changed the title Fix ls output for files and coloring Fix ls output for files and make ls respect NO_COLOR Jan 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

target-shell ls on a file does not print file information

1 participant