hyperlayout
hyperlayout copied to clipboard
Hyperlayout does nothing: SyntaxError
I'm getting errors in my console when I try out an example.
The black rectangle is Hyper, but it doesn't like to be screenshotted for some reason :)
All I did was run: hyperlayout
Hi, I am getting the same on a Windows 8.1 machine: Hyper version: 1.4.8 hyperlayout: 0.2.1 node: 8.9.4
Apparently the problem is that the string to be parsed as JSON to the middlewares is not valid, this is the output of the string: "{"config":{"entry":"tab","layout":[["echo 'hola'","echo 'adios'"]]},"cwd":"C:\Users\Alvaro_2"}[0K[?25l" so after the correct json object is adding extra stuff. But that object has more elements that also have more extra characters:
I did the same as Donaldini, just create the .hyperlayout file and run hyperlayout on hyper
The issue can be fixed by editing index.js:162
From const config = JSON.parse(testedData[1])
to const config = JSON.parse(testedData[1].substring(0, testedData[1].lastIndexOf('}') + 1));
The issue can be fixed by editing index.js:162 From
const config = JSON.parse(testedData[1])
toconst config = JSON.parse(testedData[1].substring(0, testedData[1].lastIndexOf('}') + 1));
Tried this, ended up crashing my terminal. Not entirely sure why.
Hello guys,
I have tried to use this code to fix this error, but I had some problems. I think this code is best when you use multiple layouts:
let dataJson = testedData['input']
.replace('<0x1b>[0Kl<0x1b>[?25l', '')
.replace('<0x1b>[0Kn', '')
.replace(/(\r\n|\n|\r)/gm, '')
.split('[hyperlayout config]:')[1]
.split('<0x1b>[0K')[0]
.replace('<0x1b>[0Kl<0x1b>[?25l', '');
const config = JSON.parse(dataJson);
<0x1b> is a symbol that appear in console. I just copy and paste to replace in code. You may have to add more symbols in .replace because different symbols appear depending on my configuration.