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!
Installation
Get it from Visual Studio Marketplace or Open VSX Registry.
Features
- Easy Configuration: Quickly create templates to simplify your terminal setup.
- Restore Last Session Automatically: Start your day smoothly by bringing back your last terminal session when you open the app.
- Session Selection: Choose which terminal session to open with just a few clicks, giving you control over your work.
- Session Removal: Easily delete any terminal sessions you no longer need, keeping your workspace tidy.
- Session Saving (Coming Soon): Preserve your current terminal session along with its icon, color, and all terminal configurations. (Note: Due to current limitations in the VSCode API, we cannot retrieve the icon, color, or last command from the terminal just yet. We hope to implement this feature in the future if the API allows it!)
- Customizable Themes: Personalize your terminal with a variety of colorful themes for icons and colors that brighten your workspace.
- ✨ Simple Session Management: Utilize the Terminal Keeper Activity for effortless session management.
- ✨ Commands Importing: Quickly import commands from files like package.json, pipenv, Makefile, grunt, gradle, gulp, ant, and more.
Using the extension
- Open the Command Palette using Ctrl + Shift + P (Windows) or Cmd + Shift + P (macOS).
- 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 ✨
Import session from different source ✨
Generate configuration
Active on startup
Distinct random colors and icons
Choose session to activate
Active session in workspace directory
Remove unwanted sessions
Quick configuration access
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