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

terminus-persistence

by gabriel-lody ST3 New

Automatic state persistence for Sublime Text Terminus plugin

Details

Installs

  • Total 59
  • Win 38
  • Mac 8
  • Linux 13
Mar 27 Mar 26 Mar 25 Mar 24 Mar 23 Mar 22 Mar 21 Mar 20 Mar 19 Mar 18 Mar 17 Mar 16 Mar 15 Mar 14 Mar 13 Mar 12 Mar 11 Mar 10 Mar 9 Mar 8 Mar 7 Mar 6 Mar 5 Mar 4 Mar 3 Mar 2 Mar 1 Feb 28 Feb 27 Feb 26 Feb 25 Feb 24 Feb 23 Feb 22 Feb 21 Feb 20 Feb 19 Feb 18 Feb 17 Feb 16 Feb 15 Feb 14 Feb 13 Feb 12 Feb 11
Windows 40 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Mac 8 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Linux 14 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

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