mirror of
https://github.com/RGBCube/serenity
synced 2025-05-16 20:05:07 +00:00
Shell: Support HISTFILE environment variable
This allows changing the Shell's history file path.
This commit is contained in:
parent
b2e4fe1299
commit
4a4b1b1131
2 changed files with 10 additions and 7 deletions
|
@ -960,10 +960,9 @@ void Shell::block_on_job(RefPtr<Job> job)
|
|||
|
||||
String Shell::get_history_path()
|
||||
{
|
||||
StringBuilder builder;
|
||||
builder.append(home);
|
||||
builder.append("/.history");
|
||||
return builder.to_string();
|
||||
if (auto histfile = getenv("HISTFILE"))
|
||||
return { histfile };
|
||||
return String::formatted("{}/.history", home);
|
||||
}
|
||||
|
||||
String Shell::escape_token(const String& token)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue