Skip to content

When quitting ghostty, bash isn't writing history from open sessions #9773

@jparise

Description

@jparise

Discussed in #4738

Originally posted by wlonkly January 6, 2025
If I quit ghostty, running bash sessions do not write their most recent history out to the history file. If I close a surface, bash writes its history fine, it's only on quit that this happens.

Reproducible with the default config.

It appears that this is only a problem at the prompt, too -- if I start a "sleep 1000", then the bash session writes its history. This got me wondering if it was a shell integration issue, but shell-integraton = none does not help.

ghostty version:

Ghostty 1.0.1

Version
  - version: 1.0.1
  - channel: stable
Build Config
  - Zig version: 0.13.0
  - build mode : builtin.OptimizeMode.ReleaseFast
  - app runtime: apprt.Runtime.none
  - font engine: font.main.Backend.coretext
  - renderer   : renderer.Metal
  - libxev     : main.Backend.kqueue

on MacOS 15.0.1 with bash 5.2.15(1)-release.

I don't have anything too interesting in terms of bash history config:

HISTCONTROL=ignoreboth
HISTSIZE=100000
HISTTIMEFORMAT=%F %T
HISTFILE=/Users/rich/.bash_history_safe
HISTFILESIZE=100000
```</div>

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions