Skip to content

Unexpected escape sequence from terminal: ['\x1b', '\x7f']

Checklist

  • I'm using the latest version of the extension (Run glab --version)
    • Extension version: 1.43.0
  • Operating system and version: macOS Sonoma 14.5
  • Gitlab.com or self-managed instance? self-managed instance
  • GitLab version (if self-managed) 16.10.2-ee (Use the version endpoint, like this: gitlab.my-company.com/api/v4/version)
  • I have performed glab auth status to check for authentication issues

Summary

Executing glab mr create asks you for certain data. One field the command asks for is the "Title" of the MR. If you start writing your title, but then want to remove a complete word, there are certain terminal emulators (such as iTerm2) that allow you to delete complete words by pressing Option + Backspace.

When pressing that key combination, the glab command will crash with a message saying:

unexpected escape sequence from terminal: ['\x1b', '\x7f']

Environment

  • OS: Darwin 23.5.0 arm64
  • SHELL: /bin/zsh
  • TERM: xterm-256color
  • GLAB: glab version 1.43.0 (2024-06-24)

Other:

Steps to reproduce

  1. Execute the glab mr create command
  2. Choose any template
  3. When asked for a title press Option + Backspace

What is the current bug behavior?

glab crashes

What is the expected correct behavior?

Allow the sequence to be received by glab and delete the complete word; at least don't crash.

Possible fixes

I'm not familiar with the code, but I'm open to help if necessary to fix this with a bit of hints of where the error may be.

Edited by David Sánchez
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information