Skip to content

Add WezTerm terminal installer with Windows/Linux version choice#450

Open
Copilot wants to merge 4 commits intodevelopmentfrom
copilot/create-wezterm-installer
Open

Add WezTerm terminal installer with Windows/Linux version choice#450
Copilot wants to merge 4 commits intodevelopmentfrom
copilot/create-wezterm-installer

Conversation

Copy link
Contributor

Copilot AI commented Nov 26, 2025

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 menu
    • Windows: Downloads installer from GitHub releases
    • Linux: Installs via official APT repository (apt.fury.io/wez)
  • pengwin-setup.d/uninstall/wezterm.sh - Removes Linux package, APT repo, and GPG key
  • pengwin-setup.d/terminal.sh - Added WEZTERM to Terminal menu
  • pengwin-setup.d/uninstall.sh - Added WEZTERM to uninstall menu
  • completions/pengwin-setup - Added completions for WEZTERM and WEZT_WINDOWS/WEZT_LINUX sub-options
  • tests/wezterm.sh - Unit tests for install/uninstall

Usage

# Interactive
pengwin-setup  # GUI > Terminal > WezTerm

# Non-interactive
pengwin-setup install GUI TERMINAL WEZTERM WEZT_LINUX
pengwin-setup install GUI TERMINAL WEZTERM WEZT_WINDOWS
pengwin-setup install UNINSTALL WEZTERM
Original prompt

create an installer for wezterm: https://wezterm.org/ but in this time you'll also ask if the user want the Windows or the Linux version. i am not clear if there is any advantages of any despite the better window management in the case of Windows


💡 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.

Copilot AI and others added 2 commits November 26, 2025 14:11
Co-authored-by: crramirez <8397379+crramirez@users.noreply.github.com>
Co-authored-by: crramirez <8397379+crramirez@users.noreply.github.com>
Copilot AI changed the title [WIP] Add installer creation for WezTerm with OS selection Add WezTerm terminal installer with Windows/Linux version choice Nov 26, 2025
Copilot AI requested a review from crramirez November 26, 2025 14:16
mapfile -t COMPREPLY < <(compgen -W 'WEZTERM WINTERM WSLTTY TILIX GTERM XFTERM TERMINATOR KONSO' -- "${cur}")
;;
WEZTERM)
mapfile -t COMPREPLY < <(compgen -W 'WINDOWS LINUX' -- "${cur}")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot WINDOWS and LINUX as keys are too generic and can cause collisions. I suggest put something like WEZT_ prefix

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed to WEZT_WINDOWS and WEZT_LINUX in commit 0da362d.

Co-authored-by: crramirez <8397379+crramirez@users.noreply.github.com>
@crramirez crramirez marked this pull request as ready for review November 26, 2025 16:12
Copilot AI review requested due to automatic review settings November 26, 2025 16:12
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +70 to +72
# 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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment on lines +23 to +27
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)

Copy link

Copilot AI Nov 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Suggested change
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)

Copilot uses AI. Check for mistakes.
Comment on lines +36 to +39
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

Copy link

Copilot AI Nov 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Suggested change
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

Copilot uses AI. Check for mistakes.
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
Copy link

Copilot AI Nov 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Suggested change
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

Copilot uses AI. Check for mistakes.
# 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"

Copy link

Copilot AI Nov 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
fi

This follows the pattern used in uninstall/lamp.sh and uninstall/vscode.sh.

Suggested change
# Update package lists after removing repository
if [[ -x "$(command -v update_packages)" ]]; then
update_packages
else
sudo apt-get update
fi

Copilot uses AI. Check for mistakes.
Comment on lines +11 to +13
# Downloads and runs the Windows installer
# Arguments:
# None
Copy link

Copilot AI Nov 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
#######################################
Suggested change
# 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

Copilot uses AI. Check for mistakes.
Comment on lines +54 to +56
# Install WezTerm for Linux using the official APT repository
# Arguments:
# None
Copy link

Copilot AI Nov 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
#######################################
Suggested change
# 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

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants