Skip to content

feat: Add syntax highlighting for shell scripts (sh/bash/zsh) #49

Closed

Description

@unhappychoice

Description

Add syntax highlighting support for shell scripts to improve the visual experience when replaying commits that involve shell scripting.

Motivation

Shell scripts (.sh, .bash, .zsh, etc.) are commonly found in repositories for:

  • Build scripts
  • Installation scripts
  • CI/CD configurations
  • Automation utilities

Currently, these files are displayed without syntax highlighting, making them less visually appealing and harder to read during replay.

Proposed Solution

Add tree-sitter parsers for shell languages:

Dependencies to add

[dependencies]
tree-sitter-bash = "0.23"  # Covers bash, sh, zsh

File extensions to support

  • .sh - Shell script
  • .bash - Bash script
  • .zsh - Zsh script
  • .fish - Fish shell (optional)
  • Files with shebang: #!/bin/sh, #!/bin/bash, #!/usr/bin/env bash, etc.

Implementation

  1. Add tree-sitter-bash to Cargo.toml
  2. Register the parser in src/syntax/mod.rs
  3. Map file extensions to the bash highlighter
  4. Update supported languages list in README and documentation

Examples

Files that would benefit:

  • install.sh
  • generate_changelog.sh
  • .bashrc, .zshrc
  • GitHub Actions scripts
  • Build automation scripts

References

Additional Context

This aligns with GitType which already supports shell script highlighting.

Activity

  1. added
    enhancement
    on Nov 13, 2025
  2. linear commented on Nov 13, 2025

    @linear
  3. added this to the 0.2.0 milestone on Nov 13, 2025
  4. added a commit that references this issue on Nov 18, 2025
    76f68e2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions