marionebl / svg-term-cli

Share terminal sessions via SVG and CSS
MIT License
3.57k stars 118 forks source link

Error: Invalid character crash on my aciinema recording #68

Open apexskier opened 3 years ago

apexskier commented 3 years ago

On the latest release, I'm getting a crash when I try to use this on my recording. This reproduces using --cast and using --in.

``` ▻ svg-term --cast=Psv7iVedvswxtGMo4AE8F2AkH { err: Error: Invalid character (in string: at index 0 at XMLStringifier.module.exports.XMLStringifier.assertLegalChar (/usr/local/lib/node_modules/svg-term-cli/node_modules/xmlbuilder/lib/XMLStringifier.js:153:15) at XMLStringifier.assertLegalChar (/usr/local/lib/node_modules/svg-term-cli/node_modules/xmlbuilder/lib/XMLStringifier.js:4:59) at XMLStringifier.module.exports.XMLStringifier.eleText (/usr/local/lib/node_modules/svg-term-cli/node_modules/xmlbuilder/lib/XMLStringifier.js:33:19) at new XMLText (/usr/local/lib/node_modules/svg-term-cli/node_modules/xmlbuilder/lib/XMLText.js:17:35) at XMLElement.module.exports.XMLNode.text (/usr/local/lib/node_modules/svg-term-cli/node_modules/xmlbuilder/lib/XMLNode.js:165:15) at XMLElement.module.exports.XMLNode.txt (/usr/local/lib/node_modules/svg-term-cli/node_modules/xmlbuilder/lib/XMLNode.js:365:19) at walk_obj (/usr/local/lib/node_modules/svg-term-cli/node_modules/plist/lib/build.js:127:30) at walk_obj (/usr/local/lib/node_modules/svg-term-cli/node_modules/plist/lib/build.js:110:9) at walk_obj (/usr/local/lib/node_modules/svg-term-cli/node_modules/plist/lib/build.js:110:9) at Object.build (/usr/local/lib/node_modules/svg-term-cli/node_modules/plist/lib/build.js:75:3) } /usr/local/lib/node_modules/svg-term-cli/lib/cli.js:406 throw err; ^ Error: Invalid character (in string: at index 0 at XMLStringifier.module.exports.XMLStringifier.assertLegalChar (/usr/local/lib/node_modules/svg-term-cli/node_modules/xmlbuilder/lib/XMLStringifier.js:153:15) at XMLStringifier.assertLegalChar (/usr/local/lib/node_modules/svg-term-cli/node_modules/xmlbuilder/lib/XMLStringifier.js:4:59) at XMLStringifier.module.exports.XMLStringifier.eleText (/usr/local/lib/node_modules/svg-term-cli/node_modules/xmlbuilder/lib/XMLStringifier.js:33:19) at new XMLText (/usr/local/lib/node_modules/svg-term-cli/node_modules/xmlbuilder/lib/XMLText.js:17:35) at XMLElement.module.exports.XMLNode.text (/usr/local/lib/node_modules/svg-term-cli/node_modules/xmlbuilder/lib/XMLNode.js:165:15) at XMLElement.module.exports.XMLNode.txt (/usr/local/lib/node_modules/svg-term-cli/node_modules/xmlbuilder/lib/XMLNode.js:365:19) at walk_obj (/usr/local/lib/node_modules/svg-term-cli/node_modules/plist/lib/build.js:127:30) at walk_obj (/usr/local/lib/node_modules/svg-term-cli/node_modules/plist/lib/build.js:110:9) at walk_obj (/usr/local/lib/node_modules/svg-term-cli/node_modules/plist/lib/build.js:110:9) at Object.build (/usr/local/lib/node_modules/svg-term-cli/node_modules/plist/lib/build.js:75:3) 1 ↩ ```
thinkjrs commented 3 years ago

Looks like a similar issue for me, as well. I'm on version 2.1.1 and node version v14.16.0.

Terminal input/output using the Parrot cast from the README:

cat 113643.json | svg-term
{
  err: Error: Invalid character (in string:  at index 0
      at XMLStringifier.module.exports.XMLStringifier.assertLegalChar (/Users/jason/.fnm/node-versions/v14.16.0/installation/lib/node_modules/svg-term-cli/node_modules/xmlbuilder/lib/XMLStringifier.js:153:15)
      at XMLStringifier.assertLegalChar (/Users/jason/.fnm/node-versions/v14.16.0/installation/lib/node_modules/svg-term-cli/node_modules/xmlbuilder/lib/XMLStringifier.js:4:59)
      at XMLStringifier.module.exports.XMLStringifier.eleText (/Users/jason/.fnm/node-versions/v14.16.0/installation/lib/node_modules/svg-term-cli/node_modules/xmlbuilder/lib/XMLStringifier.js:33:19)
      at new XMLText (/Users/jason/.fnm/node-versions/v14.16.0/installation/lib/node_modules/svg-term-cli/node_modules/xmlbuilder/lib/XMLText.js:17:35)
      at XMLElement.module.exports.XMLNode.text (/Users/jason/.fnm/node-versions/v14.16.0/installation/lib/node_modules/svg-term-cli/node_modules/xmlbuilder/lib/XMLNode.js:165:15)
      at XMLElement.module.exports.XMLNode.txt (/Users/jason/.fnm/node-versions/v14.16.0/installation/lib/node_modules/svg-term-cli/node_modules/xmlbuilder/lib/XMLNode.js:365:19)
      at walk_obj (/Users/jason/.fnm/node-versions/v14.16.0/installation/lib/node_modules/svg-term-cli/node_modules/plist/lib/build.js:127:30)
      at walk_obj (/Users/jason/.fnm/node-versions/v14.16.0/installation/lib/node_modules/svg-term-cli/node_modules/plist/lib/build.js:110:9)
      at walk_obj (/Users/jason/.fnm/node-versions/v14.16.0/installation/lib/node_modules/svg-term-cli/node_modules/plist/lib/build.js:110:9)
      at Object.build (/Users/jason/.fnm/node-versions/v14.16.0/installation/lib/node_modules/svg-term-cli/node_modules/plist/lib/build.js:75:3)
}
/Users/jason/.fnm/node-versions/v14.16.0/installation/lib/node_modules/svg-term-cli/lib/cli.js:406
            throw err;
            ^

Error: Invalid character (in string:  at index 0
    at XMLStringifier.module.exports.XMLStringifier.assertLegalChar (/Users/jason/.fnm/node-versions/v14.16.0/installation/lib/node_modules/svg-term-cli/node_modules/xmlbuilder/lib/XMLStringifier.js:153:15)
    at XMLStringifier.assertLegalChar (/Users/jason/.fnm/node-versions/v14.16.0/installation/lib/node_modules/svg-term-cli/node_modules/xmlbuilder/lib/XMLStringifier.js:4:59)
    at XMLStringifier.module.exports.XMLStringifier.eleText (/Users/jason/.fnm/node-versions/v14.16.0/installation/lib/node_modules/svg-term-cli/node_modules/xmlbuilder/lib/XMLStringifier.js:33:19)
    at new XMLText (/Users/jason/.fnm/node-versions/v14.16.0/installation/lib/node_modules/svg-term-cli/node_modules/xmlbuilder/lib/XMLText.js:17:35)
    at XMLElement.module.exports.XMLNode.text (/Users/jason/.fnm/node-versions/v14.16.0/installation/lib/node_modules/svg-term-cli/node_modules/xmlbuilder/lib/XMLNode.js:165:15)
    at XMLElement.module.exports.XMLNode.txt (/Users/jason/.fnm/node-versions/v14.16.0/installation/lib/node_modules/svg-term-cli/node_modules/xmlbuilder/lib/XMLNode.js:365:19)
    at walk_obj (/Users/jason/.fnm/node-versions/v14.16.0/installation/lib/node_modules/svg-term-cli/node_modules/plist/lib/build.js:127:30)
    at walk_obj (/Users/jason/.fnm/node-versions/v14.16.0/installation/lib/node_modules/svg-term-cli/node_modules/plist/lib/build.js:110:9)
    at walk_obj (/Users/jason/.fnm/node-versions/v14.16.0/installation/lib/node_modules/svg-term-cli/node_modules/plist/lib/build.js:110:9)
    at Object.build (/Users/jason/.fnm/node-versions/v14.16.0/installation/lib/node_modules/svg-term-cli/node_modules/plist/lib/build.js:75:3)