aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfenix <Daystar999964@gmail.com>2021-04-27 20:01:53 -0700
committerfenix <Daystar999964@gmail.com>2021-04-27 20:01:53 -0700
commit72890b966e7225626106d399452c2bdfbe5b2d33 (patch)
tree81a88c9c86cbf19a7dae0d47fbf589dcc5bb5c59
parentAdded Screen-overview.yaml & Screen.nonfunctional.txt (diff)
parentMerge pull request #1 from zellij-org/main (diff)
downloadsl0ppij-72890b966e7225626106d399452c2bdfbe5b2d33.tar.gz
sl0ppij-72890b966e7225626106d399452c2bdfbe5b2d33.tar.xz
sl0ppij-72890b966e7225626106d399452c2bdfbe5b2d33.zip
Merge remote-tracking branch 'origin/main' into main
-rw-r--r--.github/ISSUE_TEMPLATE/bug_report.md25
-rw-r--r--.github/workflows/release.yml89
-rw-r--r--.gitignore1
-rw-r--r--CHANGELOG.md1
-rw-r--r--assets/completions/_zellij90
-rw-r--r--assets/completions/zellij.bash117
-rw-r--r--assets/completions/zellij.fish17
-rw-r--r--build.rs23
-rw-r--r--src/cli.rs3
-rw-r--r--src/main.rs14
10 files changed, 131 insertions, 249 deletions
diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
index 5e6553c9..b5098a54 100644
--- a/.github/ISSUE_TEMPLATE/bug_report.md
+++ b/.github/ISSUE_TEMPLATE/bug_report.md
@@ -1,5 +1,26 @@
---
-name: Bug Report
-about: Create a bug report
+name: "\U0001F41B Bug Report"
+about: "If something isn't working as expected."
labels: bug
---
+Thank you for taking the time to file an issue!
+You can erase any parts of this template not applicable to your issue.
+
+## In Case of Graphical, or Performance Issues
+
+Please run `zellij --debug` and then recreate your issue.
+
+Please attach the files that were created in
+
+`/tmp/zellij/zellij-log/`
+
+To the extent you are comfortable with.
+
+Also please add the size in columns/lines of the terminal in which the bug happened. You can usually find these out with `tput lines` and `tput cols`.
+
+And the name and version of progams you interacted with as well as
+the operating system.
+
+## Information
+
+`zellij --version`:
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
new file mode 100644
index 00000000..95969961
--- /dev/null
+++ b/.github/workflows/release.yml
@@ -0,0 +1,89 @@
+name: release
+on:
+ push:
+ tags:
+ - 'v*.*.*'
+jobs:
+ build-release:
+ needs: create-release
+ name: build-release
+ runs-on: ${{ matrix.os }}
+ env:
+ RUST_BACKTRACE: 1
+ strategy:
+ matrix:
+ build:
+ - linux musl x64
+ - macos x64
+ include:
+ - build: linux musl x64
+ os: ubuntu-latest
+ rust: stable
+ target: x86_64-unknown-linux-musl
+ - build: macos x64
+ os: macos-latest
+ rust: stable
+ target: x86_64-apple-darwin
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v2
+
+ - name: Install Rust
+ uses: actions-rs/toolchain@v1
+ with:
+ toolchain: ${{ matrix.rust }}
+ profile: minimal
+ override: true
+ target: ${{ matrix.target }}
+
+ - name: Add WASM target
+ run: rustup target add wasm32-wasi
+
+ - name: Install cargo-make
+ run: cargo install --debug cargo-make
+
+ - name: Install musl-tools
+ if: matrix.os == 'ubuntu-latest'
+ run: sudo apt-get install -y --no-install-recommends musl-tools
+
+ - name: Install wasm-opt
+ run: brew install binaryen
+
+ - name: Build release binary
+ run: cargo make ci-build-release ${{ matrix.target }}
+
+ - name: Strip release binary
+ run: strip "target/${{ matrix.target }}/release/zellij"
+
+ - name: Tar release
+ id: make-artifact
+ working-directory: ./target/${{ matrix.target }}/release
+ run: |
+ name="zellij-${GITHUB_REF#refs/tags/}-${{ matrix.target }}.tar.gz"
+ tar cvfz "${name}" "zellij"
+ echo "::set-output name=name::${name}"
+ - name: Upload release archive
+ uses: actions/upload-release-asset@v1.0.1
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ with:
+ upload_url: ${{ needs.create-release.outputs.upload_url }}
+ asset_path: ./target/${{ matrix.target }}/release/${{ steps.make-artifact.outputs.name }}
+ asset_name: zellij-v${{ github.event.release.tag_name }}-${{matrix.target}}.tar.gz
+ asset_content_type: application/octet-stream
+ create-release:
+ runs-on: ubuntu-latest
+ outputs:
+ upload_url: ${{ steps.create_release.outputs.upload_url }}
+ steps:
+ - name: create_release
+ id: create_release
+ uses: actions/create-release@v1
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ with:
+ tag_name: ${{ github.ref }}
+ release_name: Release ${{ github.ref }}
+ draft: false
+ prerelease: false
+
diff --git a/.gitignore b/.gitignore
index a5d0f5fc..f211f382 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,3 +2,4 @@
*.new
.vscode
.vim
+.DS_Store \ No newline at end of file
diff --git a/CHANGELOG.md b/CHANGELOG.md
index ed90c8a1..1fdd3f21 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,6 +6,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
## [Unreleased]
* Doesn't quit anymore on single `q` press while in tab mode (https://github.com/zellij-org/zellij/pull/342)
+* Completions are not assets anymore, but commands `option --generate-completion [shell]` (https://github.com/zellij-org/zellij/pull/369)
## [0.5.1] - 2021-04-23
* Change config to flag (https://github.com/zellij-org/zellij/pull/300)
diff --git a/assets/completions/_zellij b/assets/completions/_zellij
deleted file mode 100644
index 774a28fa..00000000
--- a/assets/completions/_zellij
+++ /dev/null
@@ -1,90 +0,0 @@
-#compdef zellij
-
-autoload -U is-at-least
-
-_zellij() {
- typeset -A opt_args
- typeset -a _arguments_options
- local ret=1
-
- if is-at-least 5.2; then
- _arguments_options=(-s -S -C)
- else
- _arguments_options=(-s -C)
- fi
-
- local context curcontext="$curcontext" state line
- _arguments "${_arguments_options[@]}" \
-'-s+[Send "split (direction h == horizontal / v == vertical)" to active zellij session]' \
-'--split=[Send "split (direction h == horizontal / v == vertical)" to active zellij session]' \
-'-o+[Send "open file in new pane" to active zellij session]' \
-'--open-file=[Send "open file in new pane" to active zellij session]' \
-'--max-panes=[Maximum panes on screen, caution: opening more panes will close old ones]' \
-'--data-dir=[Change where zellij looks for layouts and plugins]' \
-'-l+[Path to a layout yaml file]' \
-'--layout=[Path to a layout yaml file]' \
-'-c+[Change where zellij looks for the configuration]' \
-'--config=[Change where zellij looks for the configuration]' \
-'-m[Send "move focused pane" to active zellij session]' \
-'--move-focus[Send "move focused pane" to active zellij session]' \
-'-d[]' \
-'--debug[]' \
-'-h[Prints help information]' \
-'--help[Prints help information]' \
-'-V[Prints version information]' \
-'--version[Prints version information]' \
-":: :_zellij_commands" \
-"*::: :->zellij" \
-&& ret=0
- case $state in
- (zellij)
- words=($line[1] "${words[@]}")
- (( CURRENT += 1 ))
- curcontext="${curcontext%:*:*}:zellij-command-$line[1]:"
- case $line[1] in
- (option)
-_arguments "${_arguments_options[@]}" \
-'--clean[Disables loading of configuration file at default location]' \
-'-h[Prints help information]' \
-'--help[Prints help information]' \
-'-V[Prints version information]' \
-'--version[Prints version information]' \
-&& ret=0
-;;
-(help)
-_arguments "${_arguments_options[@]}" \
-'-h[Prints help information]' \
-'--help[Prints help information]' \
-'-V[Prints version information]' \
-'--version[Prints version information]' \
-&& ret=0
-;;
- esac
- ;;
-esac
-}
-
-(( $+functions[_zellij_commands] )) ||
-_zellij_commands() {
- local commands; commands=(
- "option:Change the behaviour of zellij" \
-"help:Prints this message or the help of the given subcommand(s)" \
- )
- _describe -t commands 'zellij commands' commands "$@"
-}
-(( $+functions[_zellij__help_commands] )) ||
-_zellij__help_commands() {
- local commands; commands=(
-
- )
- _describe -t commands 'zellij help commands' commands "$@"
-}
-(( $+functions[_zellij__option_commands] )) ||
-_zellij__option_commands() {
- local commands; commands=(
-
- )
- _describe -t commands 'zellij option commands' commands "$@"
-}
-
-_zellij "$@" \ No newline at end of file
diff --git a/assets/completions/zellij.bash b/assets/completions/zellij.bash
deleted file mode 100644
index 9cd8f890..00000000
--- a/assets/completions/zellij.bash
+++ /dev/null
@@ -1,117 +0,0 @@
-_zellij() {
- local i cur prev opts cmds
- COMPREPLY=()
- cur="${COMP_WORDS[COMP_CWORD]}"
- prev="${COMP_WORDS[COMP_CWORD-1]}"
- cmd=""
- opts=""
-
- for i in ${COMP_WORDS[@]}
- do
- case "${i}" in
- zellij)
- cmd="zellij"
- ;;
-
- help)
- cmd+="__help"
- ;;
- option)
- cmd+="__option"
- ;;
- *)
- ;;
- esac
- done
-
- case "${cmd}" in
- zellij)
- opts=" -m -d -h -V -s -o -l -c --move-focus --debug --help --version --split --open-file --max-panes --data-dir --layout --config option help"
- if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]] ; then
- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
- return 0
- fi
- case "${prev}" in
-
- --split)
- COMPREPLY=($(compgen -f "${cur}"))
- return 0
- ;;
- -s)
- COMPREPLY=($(compgen -f "${cur}"))
- return 0
- ;;
- --open-file)
- COMPREPLY=($(compgen -f "${cur}"))
- return 0
- ;;
- -o)
- COMPREPLY=($(compgen -f "${cur}"))
- return 0
- ;;
- --max-panes)
- COMPREPLY=($(compgen -f "${cur}"))
- return 0
- ;;
- --data-dir)
- COMPREPLY=($(compgen -f "${cur}"))
- return 0
- ;;
- --layout)
- COMPREPLY=($(compgen -f "${cur}"))
- return 0
- ;;
- -l)
- COMPREPLY=($(compgen -f "${cur}"))
- return 0
- ;;
- --config)
- COMPREPLY=($(compgen -f "${cur}"))
- return 0
- ;;
- -c)
- COMPREPLY=($(compgen -f "${cur}"))
- return 0
- ;;
- *)
- COMPREPLY=()
- ;;
- esac
- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
- return 0
- ;;
-
- zellij__help)
- opts=" -h -V --help --version "
- if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
- return 0
- fi
- case "${prev}" in
-
- *)
- COMPREPLY=()
- ;;
- esac
- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
- return 0
- ;;
- zellij__option)
- opts=" -h -V --clean --help --version "
- if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
- return 0
- fi
- case "${prev}" in
-
- *)
- COMPREPLY=()
- ;;
- esac
- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
- return 0
- ;;
- esac
-}
-
-complete -F _zellij -o bashdefault -o default zellij
diff --git a/assets/completions/zellij.fish b/assets/completions/zellij.fish
deleted file mode 100644
index 4c1e536f..00000000
--- a/assets/completions/zellij.fish
+++ /dev/null
@@ -1,17 +0,0 @@
-complete -c zellij -n "__fish_use_subcommand" -s s -l split -d 'Send "split (direction h == horizontal / v == vertical)" to active zellij session'
-complete -c zellij -n "__fish_use_subcommand" -s o -l open-file -d 'Send "open file in new pane" to active zellij session'
-complete -c zellij -n "__fish_use_subcommand" -l max-panes -d 'Maximum panes on screen, caution: opening more panes will close old ones'
-complete -c zellij -n "__fish_use_subcommand" -l data-dir -d 'Change where zellij looks for layouts and plugins'
-complete -c zellij -n "__fish_use_subcommand" -s l -l layout -d 'Path to a layout yaml file'
-complete -c zellij -n "__fish_use_subcommand" -s c -l config -d 'Change where zellij looks for the configuration'
-complete -c zellij -n "__fish_use_subcommand" -s m -l move-focus -d 'Send "move focused pane" to active zellij session'
-complete -c zellij -n "__fish_use_subcommand" -s d -l debug
-complete -c zellij -n "__fish_use_subcommand" -s h -l help -d 'Prints help information'
-complete -c zellij -n "__fish_use_subcommand" -s V -l version -d 'Prints version information'
-complete -c zellij -n "__fish_use_subcommand" -f -a "option" -d 'Change the behaviour of zellij'
-complete -c zellij -n "__fish_use_subcommand" -f -a "help" -d 'Prints this message or the help of the given subcommand(s)'
-complete -c zellij -n "__fish_seen_subcommand_from option" -l clean -d 'Disables loading of configuration file at default location'
-complete -c zellij -n "__fish_seen_subcommand_from option" -s h -l help -d 'Prints help information'
-complete -c zellij -n "__fish_seen_subcommand_from option" -s V -l version -d 'Prints version information'
-complete -c zellij -n "__fish_seen_subcommand_from help" -s h -l help -d 'Prints help information'
-complete -c zellij -n "__fish_seen_subcommand_from help" -s V -l version -d 'Prints version information'
diff --git a/build.rs b/build.rs
deleted file mode 100644
index 3240db67..00000000
--- a/build.rs
+++ /dev/null
@@ -1,23 +0,0 @@
-use std::fs;
-use structopt::clap::Shell;
-
-include!("src/cli.rs");
-
-const BIN_NAME: &str = "zellij";
-
-fn main() {
- // Generate Shell Completions
- let mut clap_app = CliArgs::clap();
- println!("cargo:rerun-if-changed=src/cli.rs");
- let mut out_dir = std::env::var_os("CARGO_MANIFEST_DIR").unwrap();
- out_dir.push("/assets/completions");
-
- println!(
- "Completion files will to added to this location: {:?}",
- out_dir
- );
- fs::create_dir_all(&out_dir).unwrap();
- clap_app.gen_completions(BIN_NAME, Shell::Bash, &out_dir);
- clap_app.gen_completions(BIN_NAME, Shell::Zsh, &out_dir);
- clap_app.gen_completions(BIN_NAME, Shell::Fish, &out_dir);
-}
diff --git a/src/cli.rs b/src/cli.rs
index 008fb28c..ba6911d9 100644
--- a/src/cli.rs
+++ b/src/cli.rs
@@ -51,4 +51,7 @@ pub enum ConfigCli {
/// Disables loading of configuration file at default location
clean: bool,
},
+
+ #[structopt(name = "generate-completion")]
+ GenerateCompletion { shell: String },
}
diff --git a/src/main.rs b/src/main.rs
index ec249e8a..8da85c87 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -45,6 +45,20 @@ pub fn main() {
let mut stream = UnixStream::connect(ZELLIJ_IPC_PIPE).unwrap();
let api_command = bincode::serialize(&ApiCommand::OpenFile(file_to_open)).unwrap();
stream.write_all(&api_command).unwrap();
+ } else if let Some(crate::cli::ConfigCli::GenerateCompletion { shell }) = opts.option {
+ let shell = match shell.as_ref() {
+ "bash" => structopt::clap::Shell::Bash,
+ "fish" => structopt::clap::Shell::Fish,
+ "zsh" => structopt::clap::Shell::Zsh,
+ "powerShell" => structopt::clap::Shell::PowerShell,
+ "elvish" => structopt::clap::Shell::Elvish,
+ other => {
+ eprintln!("Unsupported shell: {}", other);
+ std::process::exit(1);
+ }
+ };
+ let mut out = std::io::stdout();
+ CliArgs::clap().gen_completions_to("zellij", shell, &mut out);
} else {
let os_input = get_os_input();
atomic_create_dir(ZELLIJ_TMP_DIR).unwrap();