Add WezTerm terminal installer with Windows/Linux version choice#450
Add WezTerm terminal installer with Windows/Linux version choice#450Copilot wants to merge 4 commits intodevelopmentfrom
Conversation
Co-authored-by: crramirez <8397379+crramirez@users.noreply.github.com>
Co-authored-by: crramirez <8397379+crramirez@users.noreply.github.com>
completions/pengwin-setup
Outdated
| mapfile -t COMPREPLY < <(compgen -W 'WEZTERM WINTERM WSLTTY TILIX GTERM XFTERM TERMINATOR KONSO' -- "${cur}") | ||
| ;; | ||
| WEZTERM) | ||
| mapfile -t COMPREPLY < <(compgen -W 'WINDOWS LINUX' -- "${cur}") |
Co-authored-by: crramirez <8397379+crramirez@users.noreply.github.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| # Add the repository | ||
| echo "deb [signed-by=/usr/share/keyrings/wezterm-fury.gpg] https://apt.fury.io/wez/ * *" | \ | ||
| sudo tee /etc/apt/sources.list.d/wezterm.list |
There was a problem hiding this comment.
Fix invalid WezTerm APT source entry
The Linux installer writes the source line deb [signed-by=/usr/share/keyrings/wezterm-fury.gpg] https://apt.fury.io/wez/ * *, which uses literal * for both the suite and component. APT requires a real suite name (e.g., / or a codename) and will request dists/*/InRelease, which the upstream repo does not provide, so update_packages and the subsequent install_packages wezterm will fail and the Linux installation path (interactive or autoinstall) never succeeds.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Pull request overview
This PR adds support for installing WezTerm terminal emulator with a choice between Windows native and Linux WSL versions, following the existing pengwin-setup patterns for terminal installers.
Key Changes
- Implements dual installation paths for WezTerm: Windows native (via GitHub releases) and Linux (via APT repository)
- Provides interactive menu for version selection with clear guidance on which version to choose
- Includes comprehensive test coverage and proper integration into existing menus and completion system
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| pengwin-setup.d/wezterm.sh | Main installer implementing Windows (GitHub releases) and Linux (APT repo) installation paths with version selection menu |
| pengwin-setup.d/uninstall/wezterm.sh | Uninstaller that removes Linux package, APT repository, and GPG key; includes note for manual Windows uninstallation |
| pengwin-setup.d/terminal.sh | Integrates WEZTERM into Terminal menu as first option with proper script invocation |
| pengwin-setup.d/uninstall.sh | Adds WEZTERM to uninstall menu in correct alphabetical position between VSCODE and WINTHEME |
| completions/pengwin-setup | Adds bash completion for WEZTERM with sub-options WEZT_WINDOWS and WEZT_LINUX |
| tests/wezterm.sh | Unit tests verifying Linux installation/uninstallation of packages, repository files, and GPG keys |
| tests/run_tests.sh | Integrates wezterm.sh test into CI test suite |
| download_url=$(curl -s https://api.github.com/repos/wez/wezterm/releases/latest | \ | ||
| grep -o '"browser_download_url": "[^"]*WezTerm-windows-[^"]*\.exe"' | \ | ||
| head -1 | \ | ||
| cut -d'"' -f4) | ||
|
|
There was a problem hiding this comment.
Missing error handling for curl command. If the GitHub API call fails or returns unexpected output, the grep/cut pipeline will silently fail and download_url will be empty. Consider checking the curl exit status before proceeding:
if ! download_url=$(curl -s https://api.github.com/repos/wez/wezterm/releases/latest | \
grep -o '"browser_download_url": "[^"]*WezTerm-windows-[^"]*\.exe"' | \
head -1 | \
cut -d'"' -f4); then
echo "Error: Failed to fetch WezTerm releases from GitHub"
cleantmp
return 1
fi| download_url=$(curl -s https://api.github.com/repos/wez/wezterm/releases/latest | \ | |
| grep -o '"browser_download_url": "[^"]*WezTerm-windows-[^"]*\.exe"' | \ | |
| head -1 | \ | |
| cut -d'"' -f4) | |
| local api_response | |
| api_response=$(curl -s https://api.github.com/repos/wez/wezterm/releases/latest) | |
| local curl_exit=$? | |
| if [[ ${curl_exit} -ne 0 ]]; then | |
| echo "Error: Failed to fetch WezTerm releases from GitHub" | |
| cleantmp | |
| return 1 | |
| fi | |
| download_url=$(echo "${api_response}" | \ | |
| grep -o '"browser_download_url": "[^"]*WezTerm-windows-[^"]*\.exe"' | \ | |
| head -1 | \ | |
| cut -d'"' -f4) |
| wget --progress=dot "${download_url}" -O wezterm-setup.exe 2>&1 | \ | ||
| sed -un 's/.* \([0-9]\+\)% .*/\1/p' | \ | ||
| ${DIALOG_COMMAND} --title "WezTerm" --gauge "Downloading WezTerm..." 7 50 0 | ||
|
|
There was a problem hiding this comment.
Missing error handling after wget download. If wget fails, the script will continue trying to copy and execute a non-existent file. Consider checking wget's exit status:
install_packages wget
if ! wget --progress=dot "${download_url}" -O wezterm-setup.exe 2>&1 | \
sed -un 's/.* \([0-9]\+\)% .*/\1/p' | \
${DIALOG_COMMAND} --title "WezTerm" --gauge "Downloading WezTerm..." 7 50 0; then
echo "Error: Failed to download WezTerm installer"
cleantmp
return 1
fi
if [[ ! -f wezterm-setup.exe ]]; then
echo "Error: Installer file not found after download"
cleantmp
return 1
fi| wget --progress=dot "${download_url}" -O wezterm-setup.exe 2>&1 | \ | |
| sed -un 's/.* \([0-9]\+\)% .*/\1/p' | \ | |
| ${DIALOG_COMMAND} --title "WezTerm" --gauge "Downloading WezTerm..." 7 50 0 | |
| wget --progress=dot "${download_url}" -O wezterm-setup.exe | |
| local wget_status=$? | |
| if [[ ${wget_status} -ne 0 ]]; then | |
| echo "Error: Failed to download WezTerm installer" | |
| cleantmp | |
| return 1 | |
| fi | |
| if [[ ! -f wezterm-setup.exe ]]; then | |
| echo "Error: Installer file not found after download" | |
| cleantmp | |
| return 1 | |
| fi |
| install_packages curl gpg | ||
|
|
||
| # Add the GPG key | ||
| curl -fsSL https://apt.fury.io/wez/gpg.key | sudo gpg --yes --dearmor -o /usr/share/keyrings/wezterm-fury.gpg |
There was a problem hiding this comment.
Missing error handling for GPG key download. If the curl command fails, the script will continue with an invalid GPG key. Consider adding error checking:
if ! curl -fsSL https://apt.fury.io/wez/gpg.key | sudo gpg --yes --dearmor -o /usr/share/keyrings/wezterm-fury.gpg; then
echo "Error: Failed to download or add GPG key"
return 1
fi| curl -fsSL https://apt.fury.io/wez/gpg.key | sudo gpg --yes --dearmor -o /usr/share/keyrings/wezterm-fury.gpg | |
| if ! curl -fsSL https://apt.fury.io/wez/gpg.key | sudo gpg --yes --dearmor -o /usr/share/keyrings/wezterm-fury.gpg; then | |
| echo "Error: Failed to download or add WezTerm GPG key" | |
| return 1 | |
| fi |
| # Remove APT repository and GPG key | ||
| sudo_rem_file "/etc/apt/sources.list.d/wezterm.list" | ||
| sudo_rem_file "/usr/share/keyrings/wezterm-fury.gpg" | ||
|
|
There was a problem hiding this comment.
After removing the APT repository, it's recommended to update the package list to ensure APT cache is consistent with the current sources. Consider adding:
# Remove APT repository and GPG key
sudo_rem_file "/etc/apt/sources.list.d/wezterm.list"
sudo_rem_file "/usr/share/keyrings/wezterm-fury.gpg"
# Update package lists after removing repository
if [[ -x "$(command -v update_packages)" ]]; then
update_packages
else
sudo apt-get update
fiThis follows the pattern used in uninstall/lamp.sh and uninstall/vscode.sh.
| # Update package lists after removing repository | |
| if [[ -x "$(command -v update_packages)" ]]; then | |
| update_packages | |
| else | |
| sudo apt-get update | |
| fi |
| # Downloads and runs the Windows installer | ||
| # Arguments: | ||
| # None |
There was a problem hiding this comment.
Function documentation is missing Globals and Returns sections according to the Google Shell Style Guide. Consider adding:
#######################################
# Install WezTerm for Windows using the installer from GitHub releases
# Downloads and runs the Windows installer
# Globals:
# wHome - Windows home directory path
# DIALOG_COMMAND - Dialog command to use
# Arguments:
# None
# Returns:
# 0 on success, 1 on error
#######################################| # Downloads and runs the Windows installer | |
| # Arguments: | |
| # None | |
| # Downloads and runs the Windows installer | |
| # Globals: | |
| # wHome - Windows home directory path | |
| # DIALOG_COMMAND - Dialog command to use | |
| # Arguments: | |
| # None | |
| # Returns: | |
| # 0 on success, 1 on error |
| # Install WezTerm for Linux using the official APT repository | ||
| # Arguments: | ||
| # None |
There was a problem hiding this comment.
Function documentation is missing Globals and Returns sections according to the Google Shell Style Guide. Consider adding:
#######################################
# Install WezTerm for Linux using the official APT repository
# Globals:
# None
# Arguments:
# None
# Returns:
# 0 on success, 1 on error
#######################################| # Install WezTerm for Linux using the official APT repository | |
| # Arguments: | |
| # None | |
| # Install WezTerm for Linux using the official APT repository | |
| # Globals: | |
| # None | |
| # Arguments: | |
| # None | |
| # Returns: | |
| # 0 on success, 1 on error |
Adds installer for WezTerm terminal emulator with option to install either the Windows native version (better window management) or the Linux version (requires X/WSLg).
Changes
pengwin-setup.d/wezterm.sh- Main installer with version selection menuapt.fury.io/wez)pengwin-setup.d/uninstall/wezterm.sh- Removes Linux package, APT repo, and GPG keypengwin-setup.d/terminal.sh- Added WEZTERM to Terminal menupengwin-setup.d/uninstall.sh- Added WEZTERM to uninstall menucompletions/pengwin-setup- Added completions for WEZTERM and WEZT_WINDOWS/WEZT_LINUX sub-optionstests/wezterm.sh- Unit tests for install/uninstallUsage
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.