{"id":17963276,"url":"https://github.com/sparanoid/fish_apple_terminal","last_synced_at":"2026-01-30T02:49:25.612Z","repository":{"id":66292420,"uuid":"215586812","full_name":"sparanoid/fish_apple_terminal","owner":"sparanoid","description":"Save/restore fish state (aka. session history) for macOS, inspired by /etc/bashrc_Apple_Terminal","archived":false,"fork":false,"pushed_at":"2024-11-21T08:20:20.000Z","size":5,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-09T07:31:55.099Z","etag":null,"topics":["bash","fish","fish-shell","macos","terminal","zsh"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sparanoid.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-10-16T15:50:25.000Z","updated_at":"2024-12-30T02:29:03.000Z","dependencies_parsed_at":null,"dependency_job_id":"5e0d9d4b-91e7-4ec5-b865-a9ceb1e06837","html_url":"https://github.com/sparanoid/fish_apple_terminal","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sparanoid%2Ffish_apple_terminal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sparanoid%2Ffish_apple_terminal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sparanoid%2Ffish_apple_terminal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sparanoid%2Ffish_apple_terminal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sparanoid","download_url":"https://codeload.github.com/sparanoid/fish_apple_terminal/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247062272,"owners_count":20877246,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bash","fish","fish-shell","macos","terminal","zsh"],"created_at":"2024-10-29T11:25:07.349Z","updated_at":"2026-01-30T02:49:25.521Z","avatar_url":"https://github.com/sparanoid.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fish_apple_terminal.fish\n\nSave/restore fish state for macOS, inspired by `/etc/bashrc_Apple_Terminal`\n\n## The Problem\n\nZ shell (`zsh`) becomes the default shell program for Terminal.app since macOS Catalina (10.15). After playing around with it for a while, I found it didn't work for me:\n\n- The default configuration of `zsh` is just another `bash`. If you need fancy autocomplete, autosuggestion, etc. You need to install plugins to achieve them, like [zsh-completions](https://github.com/zsh-users/zsh-completions), [zsh-autosuggestions](https://github.com/zsh-users/zsh-autosuggestions), and [oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh). But after installing all these plugins, your shell will become unstable. Mine got 100% CPU usage for some long-running stdout processes with default oh-my-zsh configurations.\n- Apple doesn't provide a session save/restore mechanism for `zsh`, which was available for `bash`. It is one of my favorite features of macOS Terminal.app. It can save your `bash` history per tab/window and restore them even after you restart the system.\n\nThen, I tried `fish`. It's incredible, it just works out-of-the-box and performant. But I still miss the session save/restore feature. So I wrote one based on Apple's implementation in `/etc/bashrc_Apple_Terminal`. It has a simpler logic:\n\n- When there's no history file for the current session:\n  - Create one for each tab/window based on `$TERM_SESSION_ID`\n  - Copy existing history from the shared history, which is the default history (typically `~/.local/share/fish/fish_history`).\n- Save the history since you start the session back to the shared history.\n\nThe current version does not have the expiration check feature. I'll try to add it when I have time. PRs are also welcome.\n\n## Install\n\nDownload and put the script in `~/.config/fish/conf.d/`. Or just run:\n\n```bash\nwget -P ~/.config/fish/conf.d/ https://github.com/sparanoid/fish_apple_terminal/raw/master/fish_apple_terminal.fish\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsparanoid%2Ffish_apple_terminal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsparanoid%2Ffish_apple_terminal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsparanoid%2Ffish_apple_terminal/lists"}