Terminal Keeper

Visual Studio Marketplace Version Open VSX Installs Visual Studio Marketplace Installs Visual Studio Marketplace Downloads Visual Studio Marketplace Rating (Stars) GitHub license

Terminal Keeper

Elevate your terminal experience! Effortlessly configuration, seamlessly restore your last session, and manage sessions with ease. Personalize your workspace with colorful themes and boost productivity by importing commands swiftly.

If you find this extension useful for your projects, please consider supporting me by Github, Patreon, KO-FI or Paypal. It’s a great way to help me maintain and improve this tool in the future. Your support is truly appreciated!

Github Patreon KO-FI Paypal

Our Sponsors ❤️

webia1 sponsor

Installation

Get it from Visual Studio Marketplace or Open VSX Registry.

Features

Using the extension

Activate the last used terminal session

  1. Open the Command Palette using Ctrl + Shift + P (Windows) or Cmd + Shift + P (macOS).
  2. Type Terminal Keeper and select your desired action, such as:
    • Generate Configuration
    • Open Configuration
    • Activate Session
    • Import Session
    • Remove Session

If this is your first time using Terminal Keeper, you’ll be prompted to generate a configuration. Choose “Yes” to create and customize your settings.

Built-in themes

Choose between randomly assigned colors and icons based on the terminal name or opt for the Dice theme for a fresh look every time you activate a session.

Terminal Keeper activity ✨

Terminal Keeper Activity

Import session from different source ✨

Terminal Keeper Import

Generate configuration

Generate configuration templates

Active on startup

Active on startup

Distinct random colors and icons

Active on startup

Choose session to activate

Choose which terminal session to activate

Active session in workspace directory

Active terminal session in your workspace directory

Remove unwanted sessions

Remove unwanted terminal sessions

Quick configuration access

Quick open configuration

Configuration

{
    // Used to determine which session to use.
    active: string,

    // Activated the session when Visual Studio Code starts up.
    activateOnStartup: boolean,

    // Keep existing terminals open when a session is executed.
    keepExistingTerminals: boolean,

    // A Boolean variable indicating whether to execute the clear command during initialization. If the value is true, the clear command will not be executed upon initialization. If the value is false, the clear command will be executed.
    noClear: boolean,

    // The theme can either automatically select colors/icons or manually.
    theme: string,

    // List of terminal sessions, multiple terminal sessions can be defined, but a default session must always exist.
    sessions: {

        // The default session
        default: [
            // Define the Non Split Terminal
            {
                name: string,
                commands: Array<string>
                // For more options, you can refer to the Terminal Options section.
            },

            // Define the Split Terminal
            [
                {
                    name: string,
                    commands: Array<string>
                },
                {
                    name: string,
                    commands: Array<string>
                }
            ]
        ],

        // Your defined session
        custom: [
            {
                name: string,
                commands: Array<string>
            },
            [
                {
                    name: string,
                    commands: Array<string>
                },
                {
                    name: string,
                    commands: Array<string>
                }
            ]
        ]
    }
}

Terminal Options

// A human-readable string which will be used to represent the terminal in the UI.
name: string,

// The command list.
commands: Array<string>,

// The operators to join multiple commands. e.g. semicolon (;), logical OR (||), logical AND (&&) and more
joinOperator?: string,

// Automatically execute the specified commands.
autoExecuteCommands?: boolean,

// A path or Uri for the current working directory to be used for the terminal.
cwd?: string,

// The id of the color. The available colors are listed in https://code.visualstudio.com/docs/getstarted/theme-color-reference.
color?: string,

// The id of the icon. The available icons are listed in https://code.visualstudio.com/api/references/icons-in-labels#icon-listing.
icon?: string,

// Object with environment variables that will be added to the editor process.
env?: object,

// When enabled the terminal will run the process as normal but not be surfaced to the user until Terminal.show is called. The typical usage for this is when you need to run something that may need interactivity but only want to tell the user about it when interaction is needed. Note that the terminals will still be exposed to all extensions as normal.
hideFromUser?: boolean,

// Opt-out of the default terminal persistence on restart and reload. This will only take effect when terminal.integrated.enablePersistentSessions is enabled.
isTransient?: boolean,

// A message to write to the terminal on first launch, note that this is not sent to the process but, rather written directly to the terminal. This supports escape sequences such a setting text style.
message?: string,

// Args for the custom shell executable. A string can be used on Windows only which allows specifying shell args in command-line format.
shellArgs?: Array<string>,

// A path to a custom shell executable to be used in the terminal.
shellPath?: string,

// Whether the terminal process environment should be exactly as provided in TerminalOptions.env. When this is false (default), the environment will be based on the window's environment and also apply configured platform settings like terminal.integrated.env.windows on top. When this is true, the complete environment must be provided as nothing will be inherited from the process or any configuration.
strictEnv?: boolean,

// ✨ Focused the terminal on startup.
focus?: boolean

Troubleshoot

If you see the error message The terminal process failed to launch: A native exception occurred during launch (posix_spawnp failed.). while running your vscode, it’s important to know that this error is not caused by the Terminal Keeper, but rather by VSCode itself. Therefore, it’s recommended that you don’t submit an issue to Terminal Keeper regarding this error.

This error is usually caused by VSCode’s inability to start a new terminal process. There could be various reasons why this error occurs, such as incorrect configuration or conflicts with other programs on your system.

If you encounter this error, you can try quitting all instances of VSCode and reopening it, or restarting your computer to see if the problem is resolved. If the problem persists, you can refer to the troubleshooting guide provided by VSCode or seek help from the VSCode community through forums or support pages.

You can find more information about this error and how to troubleshoot it at this link: https://code.visualstudio.com/docs/supporting/troubleshoot-terminal-launch

Feedback

If you discover a bug, or have a suggestion for a feature request, please submit an issue.

LICENSE

This extension is licensed under the MIT License