Conversation
Closed
791928e to
b54b11e
Compare
- Adds `startup_script` and `shutdown_script` fields to the `Session` model. - Introduces `script` field to `Pane` model. - Modifies `Session` and `Pane` models to serialize/deserialize script config. - Adds fields `startup_script` and `shutdown_script` for sessions in `tmux` parser. - Adds fields `startup_script` and `shutdown_script` for sessions in `zellij` model. - Updates `Pane` model to include an optional script field.
This commit refactors the script execution logic across multiple muxers (zellij, tmux, and zellij) to simplify and standardize how startup and shutdown scripts are handled. The key changes include: - **Unified Script Handling:** Startup and shutdown scripts are now combined with other commands into a single list and executed together. This eliminates the separate `run_script` calls. - **Command Combination:** The logic to include a script as a single command if it exists is now consistent across muxers. - **Removed `run_script`:** The `run_script` method is removed as its functionality is now integrated into the `run_commands` method.
- Modifies script path construction by utilizing `std::env::temp_dir()` to create the script path. - This change removes the hardcoded `/tmp` directory and dynamically uses the system's temporary directory. - Updates test assertions across tmux and zellij tests to reflect the change in path construction by using `contains()` instead of strict equality. - Improves portability and flexibility by avoiding a fixed temporary directory.
- Adds `startup_script` to the configuration for custom startup commands. - Adds `shutdown_script` to the configuration for custom shutdown commands. - Adds `shell` config option for specifying a custom shell. - Adds `env` configuration section to optionally set environment variables. - Introduces a `script` option to pane definitions to run a custom script. - Improves example configuration snippets in both README.md and docs/content/docs/getting-started/basics.md to reflect new config options
9c759d9 to
e9ca252
Compare
- Changes file creation permissions from 0o755 to 0o700. - Ensures that the generated script file is only accessible to the owner. - Prevents potential security risks due to overly permissive file permissions.
- Extracts the `default_path` function into a new `common` module. - Moves the implementation of `default_path` to `src/common/config/model/common.rs`. - Updates the usage of the `default_path` function in `src/common/config/model/pane.rs` and `src/common/config/model/session.rs` to import from the new `common` module. - Removes the unused `default_path` function from `src/common/config/util.rs`.
- Removes unnecessary `then` calls in `TmuxClient::stop_session` and `ZellijClient::stop_session`. - Simplifies session stopping in `Tmux`, `Zellij` to improve readability. - Updates `Tmux` and `Zellij` to use the new, refactored method. - Consistently removes unnecessary references in shell command execution.
- Removes the `env` block from the `.laito.yaml` file. - Removes the `startup_script` block from the `.laito.yaml` file. - Simplifies the configuration file structure by removing unnecessary values.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.