Skip to content

Long commit message bodies start erasing previous lines in OSX terminal #688

@fruchtose

Description

@fruchtose

Expected Behavior

I'm using Terminal on OSX. When I'm writing a commit body which goes beyond my current line length, the prompt does something weird. I would expect the editor to handle wrapped text, but it currently has a bug where wrapped text is shown in a new line in the terminal.

Current Behavior

The wrapping text replaces whatever text content is on the previous line, with newly typed characters being appended to the end. This repeats for every new character. So for example, writing the text available for Thrift would have wrapped in my editor at ble for Thrift. This results in the following text replacing the last 20 lines in my terminal with the following:

ble for Thr
ble for Th
ble for Th
ble for T
ble for T
ble for 
ble for 
ble for
ble for
ble fo
ble fo
ble f
ble f
ble 
ble 
ble
ble
bl
bl
b

Affected packages

  • cli
  • core
  • prompt
  • config-angular

Possible Solution

Steps to Reproduce (for bugs)

Dependencies:

{
    "@commitlint/cli": "^7.6.1",
    "@commitlint/config-conventional": "^7.1.2",
    "@commitlint/prompt-cli": "^7.6.1",
}
  1. Set up prompt-cli in a repo
  2. Map the package.json script commit to the command string commit
  3. Run npm run commit
  4. Start typing a commit message, so that the body wraps around the terminal.
commitlint.config.js ```js { "extends": [ "@commitlint/config-conventional" ] } ```

Context

This bug makes it difficult to use the CLI for long commit messages.

Your Environment

OSX 10.12

Executable Version
commitlint --version 7.6.1
git --version 2.14.3
node --version 12.2.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions