You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using bat on YAML files that include comments which start at the beginning of a line, that is, the first character of the line is a #, bat will hang indefinitely, and never finish displaying the file.
Contents of working file via cat:
$ cat works.yml
test: value
still: okay
# comment with hash character at beginning of line, but with a space first
will: reach here
Contents of working file via bat:
$ bat works.yml
───────┬────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
│ File: works.yml
───────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
1 │ test: value
2 │
3 │ still: okay
4 │
5 │ # comment with hash character at beginning of line, but with a space first
6 │
7 │ will: reach here
───────┴────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
$
Without the leading space in the comment line
Contents of broken file via cat:
$ cat broken.yml
test: value
still: okay
# comment with hash character at beginning of line
will: not reach here
Contents of working file via bat:
$ bat broken.yml
───────┬────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
│ File: broken.yml
───────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
1 │ test: value
2 │
3 │ still: okay
4 │
From this point on, it will linger forever and never finish. Even the comment line isn't shown. Something seems to be wrong with the syntax parsing in this case.
This looks very much like the bug that I have reported upstream, as @keith-hall mentioned. It only appeared if a syntax set was dumped to disk and reloaded again.
Did you use bat cache --init in the past (with an older version of bat)? Can you try to run
bat cache --clear
to see if the error goes away?
If that is the case, you should be able to run bat cache --init again without any issues.
When using
bat
on YAML files that include comments which start at the beginning of a line, that is, the first character of the line is a#
,bat
will hang indefinitely, and never finish displaying the file.Contents of working file via
cat
:Contents of working file via
bat
:Without the leading space in the comment line
Contents of broken file via
cat
:Contents of working file via
bat
:From this point on, it will linger forever and never finish. Even the comment line isn't shown. Something seems to be wrong with the syntax parsing in this case.
It does work with the
-A
flag enabled:It is consistently repeatable. Different values of
--style
do not change the outcome, it hangs every time.bat
installed via Homebrew on OS X Mojave.The text was updated successfully, but these errors were encountered: