Giter Club home page Giter Club logo

wezterm-session-manager's Introduction

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

  • Save Session State Captures the current layout of windows, tabs and panes, along with their working directories and foreground processes.
  • restore Session Reopens a previously saved session that matches the current workspace name, restoring its layout and directories.
  • Load Session (Not implemented yet) Allows selecting which saved session to load, regardless of the current workspace name.

Installation

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

    git clone https://github.com/danielcopper/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("load_session", function(window) session_manager.load_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 = "L", mods = "LEADER", action = wezterm.action{EmitEvent = "load_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:

  • The script does not restore the state of running applications within each pane (except nvim on linux which seems to work fine but the general handling should be improved)
  • It' primarily tested on Linux and Windows, expect some bugs or adjustements that need to be made
  • Complex pane layouts won't be correctly restored, the current implementation to determine the pane position is extremely basic

Contributing

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

wezterm-session-manager's People

Contributors

danielcopper avatar yonatanl2 avatar zdonik1 avatar waldirborbajr avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.