ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

terminus-persistence

by gabriel-lody ST3

Automatic state persistence for Sublime Text Terminus plugin

Details

Installs

  • Total 1K
  • Win 879
  • Mac 242
  • Linux 296
Jun 10 Jun 9 Jun 8 Jun 7 Jun 6 Jun 5 Jun 4 Jun 3 Jun 2 Jun 1 May 31 May 30 May 29 May 28 May 27 May 26 May 25 May 24 May 23 May 22 May 21 May 20 May 19 May 18 May 17 May 16 May 15 May 14 May 13 May 12 May 11 May 10 May 9 May 8 May 7 May 6 May 5 May 4 May 3 May 2 May 1 Apr 30 Apr 29 Apr 28 Apr 27 Apr 26
Windows 3 11 12 10 6 8 9 6 5 4 0 0 0 0 0 0 0 0 4 9 7 8 11 12 5 8 13 14 9 6 6 7 7 2 9 15 12 11 5 8 12 17 6 9 11 10
Mac 0 1 1 0 2 5 3 5 4 1 0 0 0 0 0 0 0 0 1 3 1 7 1 2 2 5 0 4 1 1 1 1 3 6 2 4 5 1 1 3 2 0 5 5 0 3
Linux 0 0 4 3 2 5 4 3 6 1 0 0 0 0 0 0 0 0 0 1 1 5 5 4 6 3 1 0 5 2 3 4 3 4 4 2 0 2 4 5 0 5 5 5 2 1

Readme

Source
raw.​githubusercontent.​com

terminus-persistence

A minimal Sublime Text plugin that remembers whether your Terminus panel was open between sessions and automatically restores it.

Features

  • Automatic State Persistence: Remembers if Terminus was open when you closed Sublime Text
  • Seamless Restoration: Automatically reopens Terminus on startup if it was previously open
  • Convenient Menu Integration: Quick access to Terminus controls via View menu
  • Configurable: Toggle persistence on/off as needed

Requirements

  • Sublime Text 3 or 4
  • Terminus plugin installed

Installation

Via Package Control

  1. Open Command Palette (Ctrl+Shift+P / Cmd+Shift+P)
  2. Select “Package Control: Install Package”
  3. Search for “terminus-persistence”
  4. Press Enter to install

Usage

Automatic Behavior

Once installed, the plugin works automatically:

  1. Open Terminus panel (via Alt+\ or Terminus commands)
  2. Close Sublime Text
  3. Reopen Sublime Text
  4. Terminus panel will automatically reopen

Menu Commands

Access via View → Terminus:

  • Toggle Persistence: Enables or disables automatic persistence (shows checkmark when enabled)

Command Palette

All commands are available via the Command Palette (Ctrl+Shift+P / Cmd+Shift+P):

  • terminus-persistence: Toggle Persistence - Enable or disable persistence
  • Preferences: terminus-persistence Settings - Open settings in split view

Configuration

Settings can be accessed via: - Menu: Preferences → Package Settings → terminus-persistence → Settings - Command Palette: Preferences: terminus-persistence Settings

Default settings:

{
    // Enable or disable automatic persistence of Terminus panel state
    "persistence_enabled": true
}

How It Works

  1. On Close: When you close a Sublime Text window, the plugin checks if a Terminus panel is visible
  2. State Storage: The visibility state is saved to a JSON file in your User directory
  3. On Startup: When Sublime Text loads, the plugin waits 1 second (to ensure Terminus is loaded) then restores the panel state
  4. Configurable: Persistence can be toggled on/off via the View menu

Files Created

The plugin creates the following files in your Sublime Text User directory (Packages/User/):

  • terminus_persistence_state.json: Stores the panel visibility state between sessions
    • Contains: terminus_was_visible (boolean) and terminus_panel_name (string or null)
    • This file is automatically created and updated when you close Sublime Text
    • Safe to delete - will be recreated on next close

Troubleshooting

Terminus doesn't reopen on startup

  • Make sure Terminus plugin is installed and enabled
  • Check that persistence is enabled: View → Terminus → Toggle Persistence (should show checkmark)
  • Try increasing the delay in plugin_loaded() if Terminus loads slowly

Menu items don't appear

  • Ensure the folder is named exactly terminus-persistence
  • Restart Sublime Text
  • Check Console for errors (View → Show Console)

Development

Project Structure

terminus-persistence/
├── terminus_persistence.py                 # Main plugin code
├── terminus-persistence.sublime-settings   # Default settings
├── terminus-persistence.sublime-commands   # Command palette entries
├── Main.sublime-menu                       # Menu integration
├── messages.json                           # Installation message config
├── messages/
│   └── install.txt                         # Post-install message
└── README.md                               # This file

Testing

  1. Enable Sublime Text console: View → Show Console
  2. Open Terminus panel
  3. Close and reopen Sublime Text
  4. Check console for any errors
  5. Verify Terminus reopens automatically

Contributing

Contributions are welcome! Please feel free to submit issues or pull requests.

License

MIT License - See LICENSE file for details

Author

Gabriel Lody

Acknowledgments

  • Terminus by randy3k - The excellent terminal emulator this plugin extends
  • Sublime Text community

Changelog

0.1.1

  • Add Command Palette support
  • Add settings menu with split view (edit_settings)
  • Add .gitattributes for clean package distribution
  • Remove obsolete state data from settings file
  • Update documentation

0.1.0 (Initial Release)

  • Basic persistence functionality
  • View menu integration
  • Toggle persistence on/off
  • Automatic state restoration