You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I would like to share some findings about the history artifact (files → shell → history) and suggest possible improvements.
Current behavior
Currently, the artifact script scans only the user home directory (~/) with max_depth: 4 and checks files matching the following patterns:
Shell coverage analysis
I did a short research of shells that can be considered relevant today:
Shell / Tool
Detection type
Comment
Any shell with custom history file path
Not supported reliably
No env/config parsing (HISTFILE, XDG_*). Only files under ~/ are scanned. Custom paths outside home are missed; inside home they may be detected only if filename matches wildcards.
Bash
Wildcard match
.bash_history is not explicitly listed, but matched by .*_history / .*history.
Ksh93 / mksh
Wildcard match
.sh_history, .ksh_history not explicitly listed; detected via wildcards.
Zsh
Wildcard match
.zsh_history not explicitly listed; detected via wildcards.
less (pager)
Explicit match
.lesshst is explicitly listed (tool history, not shell).
Fish
Explicit match
fish_history explicitly listed; default path ~/.local/share/fish/fish_history is within depth.
Xonsh
Explicit + wildcard (partial)
.xonsh_history explicitly listed (old versions). Newer JSON/SQLite in ~/.local/share/xonsh/ may be matched only if filename contains history.
Tcsh / Csh
Wildcard match
.history, .tcsh_history matched via wildcards.
Dash
Explicit + wildcard
.dash_history explicitly listed, but would also be matched by wildcards. Non-standard; appears only if user enables history manually.
Nushell (nu)
Not supported reliably
Uses its own data directory; may be missed unless filename accidentally matches wildcard under ~/.
Elvish
Wildcard match
Commonly ~/.elvish/history; filename history matches .*history. Structured/binary format.
PowerShell (pwsh) on Linux
Not supported reliably
History at ~/.local/share/powershell/PSReadLine/ConsoleHost_history.txt is deeper than max_depth: 4 and filename does not match patterns.
Oil (osh/ysh)
Not supported reliably
Uses custom mechanism; will be detected only if it writes under ~/ with history in filename.
Ion
Not supported reliably
Uses custom mechanism; will be detected only if it writes under ~/ with history in filename.
Questions about the current pattern:
The current pattern relies on wildcard values (e.g. .history, .*_history, *.historynew), which can cause false positives. Why both wildcards and explicit values were used that overlap with them?
Is cosh_history a typo? Should it be csh_history instead?
.tcsh_history is the default history file for tcsh. Should it be added, especially if wildcard patterns will be removed?
Why *.historynew was included? In which real cases does this occur?
As far as I can see, only zsh and bash use rotation mechanisms, and they typically produce files like:
.zsh_history.new, .zsh_history.tmp
.bash_history~, .bash_history.[0-9]
The glob *.historynew would not match any of these.
Suggestions
Rework the current name_pattern list to make it more explicit, safe, and predictable (avoid overly broad wildcards).
Consider dynamic detection of history files, for example:
- using environment variables (HISTFILE, XDG_DATA_HOME, etc.),
- or parsing shell configuration files.
This would improve shell coverage, support modern shells, and allow detection of custom history paths.
Thanks for your time and for maintaining this project. I hope these findings and suggestions are helpful.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I would like to share some findings about the history artifact (files → shell → history) and suggest possible improvements.
Current behavior
Currently, the artifact script scans only the user home directory (~/) with max_depth: 4 and checks files matching the following patterns:
Shell coverage analysis
I did a short research of shells that can be considered relevant today:
Questions about the current pattern:
As far as I can see, only zsh and bash use rotation mechanisms, and they typically produce files like:
.zsh_history.new, .zsh_history.tmp
.bash_history~, .bash_history.[0-9]
The glob *.historynew would not match any of these.
Suggestions
- using environment variables (HISTFILE, XDG_DATA_HOME, etc.),
- or parsing shell configuration files.
This would improve shell coverage, support modern shells, and allow detection of custom history paths.
Thanks for your time and for maintaining this project. I hope these findings and suggestions are helpful.
Beta Was this translation helpful? Give feedback.
All reactions