diff --git a/pkg/interp/repl.jq b/pkg/interp/repl.jq index 3360caf37..d11dcfe0d 100644 --- a/pkg/interp/repl.jq +++ b/pkg/interp/repl.jq @@ -105,7 +105,9 @@ def _prompt: def _type_name_error: ( . as $c | try - ( _display_name + ( ( _display_name + | if . != "" then " " + . end + ) , if ._error then "!" else empty end ) catch ($c | type) diff --git a/pkg/interp/testdata/repl.fqtest b/pkg/interp/testdata/repl.fqtest index 743f99702..53dadcd1e 100644 --- a/pkg/interp/testdata/repl.fqtest +++ b/pkg/interp/testdata/repl.fqtest @@ -63,6 +63,12 @@ $ fq -i '[1,2,3]' [1,2,3] > [number, ...][3]> ^D [number, ...][3]> ^D +$ fq -i -d mp3 '.headers[0]' /test.mp3 +.headers[0] id3v2> ^D +$ fq -i -d mp3 . /test.mp3 + mp3> .headers[0] | repl +> .headers[0] id3v2> ^D + mp3> ^D $ fq -n repl exitcode: 5 stderr: