oubiwann / wezterm-session-manager

MIT License
0 stars 0 forks source link

WezTerm Session Manager

The WezTerm Session Manager is a Lua script enhancement for WezTerm that provides functionality to save, load, and restore terminal sessions. This tool helps manage terminal sessions, its goal is to save and restore different sessions or better workspaces and later restore them.

Features

Installation

  1. Clone the Repository Clone the Repository into your WezTerm configuration directory:

    git clone https://github.com/oubiwann/wezterm-session-manager.git \
     ~/.config/wezterm/wezterm-session-manager
  2. Configure WezTerm: Edit your 'wezterm.lua' file to include the Session Manager:

    local session_manager = require("wezterm-session-manager/session-manager")
  3. Setup Event Bindings: Edit your 'wezterm.lua' to include the event bindings to trigger the functions of the session manager

    wezterm.on("save-session", function(window) session_manager.save_state(window) end)
    wezterm.on("restore-session", function(window) session_manager.restore_state(window) end)
  4. Set Keybindings: Define Keybindings in your 'wezterm.lua' for saving, restoring and loading sessions:

    local wezterm = require 'wezterm';
    return {
     keys = {
      {key = "S", mods = "LEADER", action = wezterm.action{EmitEvent = "save-session"}},
      {key = "R", mods = "LEADER", action = wezterm.action{EmitEvent = "restore-session"}},
     },
    }
  5. I also recommend to set up a keybinding for creating named workspaces as explained here. This helps managing and switching states.

Limitations

There are currently some limitations and improvements that need to be implemented:

Contributing

Feedback, bug reports, and contributions to enhance the script are welcome.