Skip to content

Weird screen rendering behaviour when invoked via npx zx #988

@hfhchan-plb

Description

@hfhchan-plb

Describe the bug
gum behaves weirdly when invoked from npx zx.

(1) The up and down keys cause the first option to be duplicated on the right.
(2) When pressing CTRL+C, the output is dumped again.

To Reproduce
Steps to reproduce the behavior:

Create the following file as index.mjs and run ./index.mjs in zsh on macOS.

#!npx zx

// @ts-check
import "zx/globals";

await $`gum choose --header "Choose deploy stage:" uat prod`

Expected behavior
gum should behave the same whether it is invoked via npx zx in zsh or via zsh.

Screenshots

Image

First part is invoked via a script via npx zx.

  • Pressing up and down keys cause the "uat" to be duplicated on the right.
  • Pressing CTRL+X causes the output to be printed again.

Desktop (please complete the following information):

  • OS: macOS 15.7.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions