Skip to content

Commit

Permalink
interp: Fix prompt issue with format
Browse files Browse the repository at this point in the history
  • Loading branch information
wader committed Oct 27, 2021
1 parent 8019212 commit cfdd922
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/interp/repl.jq
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 6 additions & 0 deletions pkg/interp/testdata/repl.fqtest
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit cfdd922

Please sign in to comment.