Skip to content

Compiler error produces unexpected output when rendered in a terminal #2302

@hovsater

Description

@hovsater

Quick Summary:

While working on https://github.com/hovsater/aoc-elm I encountered an error message that produces unexpected output inside a terminal. Specifically the error message seem to emit 65532 spaces in a row as @lydell kindly pointed out in #2302 (comment). Since the terminal wrap long lines, the result is a very long empty section to scroll through in the middle of the error message.

SSCCE

module Main exposing (main)

failingCode : List () -> List ()
failingCode list =
    case list of
        [ a, a ] -> list
        _ -> list
  • Elm: 0.19.1
  • Browser: None
  • Operating System: macOS Ventura 13.3

Additional Details

The problem can be produced when running with the JSON reporter as well (i.e., --report=json).

Here's the raw output from the terminal (produced by running script /tmp/output and then running /tmp/output through sed -n 'l'
Script started on Mon Apr 10 17:12:41 2023$
\033[?2004h~/code/elm-bug $ elm make --output=/dev/null src\
/Main.elm\r$
\033[?2004l\rCompiling ...\rDetected problems in 1 module.\
\r$
\033[36m-- NAME CLASH -------------------------------------\
---------------- src/Main.elm\033[0m\r$
\r$
This `case` pattern has multiple `a` variables.\r$
\r$
6|         [ a, a ] -> list\r$
                \033[91m^\033[0m                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
                                                           \
               \033[91m^\033[0m\r$
How can I know which one you want? Rename one of them!\r$
\r$
\033[?2004h~/code/elm-bug $ \033[?2004l\r\r$
exit\r$
$
Script done on Mon Apr 10 17:12:51 2023$

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