{"id":22325965,"url":"https://github.com/vdbulcke/ghost","last_synced_at":"2025-07-29T16:33:39.458Z","repository":{"id":192378436,"uuid":"686603773","full_name":"vdbulcke/ghost","owner":"vdbulcke","description":"A Zellij plugin for spawning floating command terminal pane.","archived":false,"fork":false,"pushed_at":"2025-03-29T11:12:22.000Z","size":541,"stargazers_count":37,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-05T16:11:14.982Z","etag":null,"topics":["rust","zellij","zellij-plugin"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vdbulcke.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-03T11:00:37.000Z","updated_at":"2025-04-02T02:52:23.000Z","dependencies_parsed_at":"2023-11-07T23:24:16.278Z","dependency_job_id":"9d962c84-02fe-4ed0-97d0-e36851a49dbd","html_url":"https://github.com/vdbulcke/ghost","commit_stats":null,"previous_names":["vdbulcke/ghost"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/vdbulcke/ghost","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vdbulcke%2Fghost","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vdbulcke%2Fghost/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vdbulcke%2Fghost/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vdbulcke%2Fghost/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vdbulcke","download_url":"https://codeload.github.com/vdbulcke/ghost/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vdbulcke%2Fghost/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267718283,"owners_count":24133448,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-29T02:00:12.549Z","response_time":2574,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["rust","zellij","zellij-plugin"],"created_at":"2024-12-04T02:14:49.325Z","updated_at":"2025-07-29T16:33:39.443Z","avatar_url":"https://github.com/vdbulcke.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ghost\n\nA [Zellij](https://zellij.dev) plugin for spawning floating command terminal pane.\nBasically, it is an interactive version of `zrf` (`function zrf () { zellij run --name \"$*\" --floating -- zsh -ic \"$*\";}`).\n\n\n![Demo](https://raw.githubusercontent.com/vdbulcke/ghost/main/img/ghost.gif)\n\n\nSince `v0.3.0`, if you define a list of completions from `global_completion` plugin configuration, it will load each lines as a list of commands that you can fuzzy search (using [fuzzy-matcher](https://crates.io/crates/fuzzy-matcher)).\n\nIf the plugin finds a `.ghost` at the working dir of the plugin, it will add the working dir completions with the global_completions.\n\n![Completion](./img/fuzzy_search.png)\n\n\n## Requirements\n\nZellij version `v0.40.0` or later.\n\n| Zellij    | ghost    |\n| --------- | -------- |\n| `v0.40.x` | `v0.4.0` |\n| `v0.41.1` | `v0.5.0` |\n\n\n### Zellij Plugin Permission \n\n| Permission               | Why                                 |\n| -------------------------|-------------------------------------|\n| `ReadApplicationState`   | Subscribe to Pane and tab events    |\n| `RunCommands`            | Creating Run Command floating pane  | \n| `ChangeApplicationState` | Setting plugin pane name            |\n\n### Host Filesystem Access\n\n\u003e NOTE: zellij `v0.39.0` changed the `/host` path on plugin from the current zellij session working dir to the previous pane working dir (see [Release Notes](https://github.com/zellij-org/zellij/releases/tag/v0.39.0) for more info)\n\n[Zellij maps the folder where Zellij was started](https://zellij.dev/documentation/plugin-api-file-system) to `/host` path on the plugin.\n\nThe plugin will look for a `/host/.ghost` file (i.e. the current working of the previous focussed pane) to load a list of predefined commands (like a bash_history).\n\n\nExample of a `.ghost` file:\n```bash\ncargo build\n## this is a comment starting with '#'\n\t# this is also a comment\nterraform apply\n\n\n\n## empty lines are also ignored\ngo test -v ./...\n\n```\n\n\n## Install\n\n### Upgrade\n\n#### Breaking Change\n\n##### v0.4.0\n\n* renamed config `cwd` with `exec_cwd`\n\n\n### Download WASM Binary\n\n\n* Download `ghost.wasm` binary from [release page](https://github.com/vdbulcke/ghost/releases).\n* Verify binary signature with cosign (see instruction bellow)\n* copy binary to zellij plugin dir: \n     - `mv target/wasm32-wasip1/release/ghost.wasm ~/.config/zellij/plugins/`\n\n\n#### Validate Signature With Cosign\n\nMake sure you have `cosign` installed locally (see [Cosign Install](https://docs.sigstore.dev/cosign/installation/)).\n\nThen you can use the `./verify_signature.sh` in this repo: \n\n```bash\n./verify_signature.sh PATH_TO_DOWNLOADED_ARCHIVE TAG_VERSION\n```\nfor example\n```bash\n$ ./verify_signature.sh ~/Downloads/ghost.wasm v0.4.0\n\nChecking Signature for version: v0.4.0\nVerified OK\n\n```\n\n\n\n\n\n### Build from source\n\n\u003e WARNING: requires to have rust installed and wasm `rustup target add wasm32-wasip1`\n\n* `git clone git@github.com:vdbulcke/ghost.git`\n* `cd ghost`\n* `cargo build --release`\n* `mv target/wasm32-wasip1/release/ghost.wasm ~/.config/zellij/plugins/`\n\n\n## Configuration\n\n### Required Configuration\n\n#### Zsh Shell\n\n| Key          | value |\n|--------------|------ |\n| `shell`      | `zsh` |\n| `shell_flag` | `-ic` |\n\n#### fish Shell\n\n| Key          | value  |\n|--------------|--------|\n| `shell`      | `fish` |\n| `shell_flag` | `-c`   |\n\n\n#### Bash Shell\n\n| Key          | value  |\n|--------------|--------|\n| `shell`      | `bash` |\n| `shell_flag` | `-ic`  |\n\n\n### Optional Configuration\n\n\n| Key                                                       | value                      | desctiption                                                |\n|-----------------------------------------------------------|----------------------------|------------------------------------------------------------|\n| ~~`cwd` (**deprecated** use `exec_cwd` instead)~~         | directory path             | set working dir for command                                |\n| ~~`exec_cwd` (zellij `0.40.0`)~~ (deprecated in `v0.6.0`) | directory path             | set working dir for command                                |\n| ~~`ghost_launcher`~~ (deprecated in `v0.6.0`)             | GhostLauncher pane name    | plugin will automatically close that pane                  |\n| `embedded`                                                | `true`                     | created command panes are embedded instead of floating     |\n| `debug`                                                   | `true`                     | display debug info                                         |\n| `global_completion`                                       | multine list of completion | global list of completion to inlude to `/host/.ghost` file |\n\n\n\u003e NOTE:  The \"GhostLauncher\" (`ghost_launcher`, `exec_cwd`) is no longer need. Now the `cwd` is derived from the `get_plugin_ids().initial_cwd` plugin api.\n\n## Launch Plugin\n\n```bash\nzellij plugin --floating --configuration \"shell=zsh,shell_flag=-ic,cwd=$(pwd)\" -- \"file:$HOME/.config/zellij/plugins/ghost.wasm\"\n```\n\n## Config Keybindings\n\n\n\n```kdl\nshared_except \"locked\" {\n\n    // ghost native plugin (with default zellij cwd)\n    bind \"Alt (\" {\n        LaunchOrFocusPlugin \"file:~/.config/zellij/plugins/ghost.wasm\" {\n            floating true\n\n            // Ghost config \n            shell \"zsh\"      // required (\"bash\", \"fish\", \"zsh\")\n            shell_flag \"-ic\" // required (\"-ic\",  \"-c\",    \"-ic\")\n\n            // optional config\n            // ghost_launcher \"GhostLauncher\" // name of the Ghost launcher pane (default GhostLauncher)\n            // debug false                    // display debug info, config, parse command etc\n            // embedded false                 // spawned command pane will be embedded instead of floating pane\n\n\n            // NOTE: using 'r#\"' and '\"#' rust like multi string delimeter\n            global_completion r#\"\n                tf apply -auto-approve\n                cargo build\n                go test -v  ./...\n                \n            \"#\n        }\n    }\n\n\n}\n```\n\n## Limitations\n\n### resizing\n\nUI column size is not handled, so resizing to plugin window too small may crash the plugin. \nUI row size is partiallt handled, where it will minimize to a simple prompt if the plugin window becomes too small.\n\n\n## Note\n\nThis my first rust project, so the code might not be the most idiomatic rust.\nInpiration was taken from other [zellij plugins](https://zellij.dev/documentation/plugin-examples).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvdbulcke%2Fghost","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvdbulcke%2Fghost","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvdbulcke%2Fghost/lists"}