Skip to content

feat: ✨ HSTRFILE environment variable for per-process isolation#547

Open
xobes wants to merge 1 commit into
dvorka-oss:dev-3.2.0from
xobes:hstrfile-env-var
Open

feat: ✨ HSTRFILE environment variable for per-process isolation#547
xobes wants to merge 1 commit into
dvorka-oss:dev-3.2.0from
xobes:hstrfile-env-var

Conversation

@xobes

@xobes xobes commented Jan 11, 2026

Copy link
Copy Markdown

Supports global hstr file and separate history file per shell.

E.g. source the following file and each bash shell will have it's own .history file per PID as well as a global. This way, each shell has it's own history (up/down arrows) which is unique to that shell; but also has access to the overall history (Ctrl-R).

(Note: these per-pid files don't get deleted presently, so that's something that needs to be considered)

hstr_sync_example.sh

@dvorka
dvorka requested a review from Copilot January 23, 2026 23:14
@dvorka dvorka self-assigned this Jan 23, 2026
@dvorka
dvorka self-requested a review January 23, 2026 23:14

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds support for a new HSTRFILE environment variable that allows users to specify a separate history file for hstr, independent of the shell's HISTFILE. This enables use cases where each shell instance maintains its own history file while hstr can access a global history file.

Changes:

  • Added ENV_VAR_HSTRFILE constant definition
  • Modified get_history_file_name() to check HSTRFILE before falling back to HISTFILE

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/include/hstr_history.h Defines the new HSTRFILE environment variable constant
src/hstr_history.c Implements fallback logic: HSTRFILE → HISTFILE → defaults

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@dvorka
dvorka changed the base branch from master to dev-3.2.0 January 24, 2026 07:25
@dvorka dvorka changed the title added HSTRFILE env var feat: ✨ HSTRFILE environment variable for per-process isolation Jan 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants