Add more robust method to retrieve config JSON from the terminal - #16
Add more robust method to retrieve config JSON from the terminal#16stereokai wants to merge 4 commits into
Conversation
timolins
left a comment
There was a problem hiding this comment.
great job! Will test this out as soon as I can.
| const {sessions} = store.getState() | ||
| const {activeUid} = sessions | ||
| // Remove ANSI escape code sequences. Visualization: https://goo.gl/IY8vuU | ||
| const ANSI_escape_codes = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/gm |
There was a problem hiding this comment.
These constants won't change, so they shouldn't be defined inside the middleware.
timolins
commented
Dec 14, 2016
Awesome! Would be cool if you changed the variables from snake_case to camelCase to obey the linter. 🐫 |
timolins
commented
Dec 14, 2016
Thanks 🙏 |
stereokai
commented
Dec 14, 2016
Green light |
timolins
commented
Dec 14, 2016
stereokai
commented
Dec 15, 2016
:( Maybe try to disable one or more of the regexes I introduced to discover the culprit? |
stereokai
commented
Dec 15, 2016
@timolins I had the same problem with PowerShell in my machine. (I tried with 3 different shells, including cmd and native Bash). The problem with PowerShell was that it was printing a security error to the terminal immediately after it was loaded - and it threw hyperlayout into a loop or a freeze somehow. Just to be more clear - that error text was being printed to the terminal before PowerShell's command prompt was visible and ready to receive commands. That error was not related to Hyper, and would happen even if I opened PowerShell independently. The moment I fixed the error, (read: removed the content that was being printed before the command prompt was available in the terminal) the freeze was gone. Does your terminal print some things before the command prompt is ready for input? |
stereokai
commented
Dec 19, 2016
@timolins still there? :) |
Awesome, thank you! Don't know how I missed this... Will check this out soon! Edit: Oh wait, I mixed something up here. For some reason I thought you fixed that issue. |
timolins
commented
Dec 21, 2016
And no, my command prompt doesn't print anything before it's ready for input. |
stereokai
commented
Dec 21, 2016
@timolins Did you try to disable one or more of the regexes I introduced to discover the culprit like I suggested? :) |
colinbate
commented
May 10, 2017
This code killed my Hyper too. It is the I've been wrestling with getting hyperlayout to work at all on Windows 7. The addition of the ANSI codes and line breaks isn't a simple one to solve. For example, my config was broken onto three lines, the first line break being inserted instead of a space within a command string. The second was inserted mid-string. If I replace the newlines with an empty string, I break that first command. |
colinbate
commented
May 10, 2017
If I change the size of my Hyper window, then the line breaks go elsewhere and can be removed more safely. Is this really the best way to communicate between the command and the plugin? |
timolins
commented
May 10, 2017
I'm open for suggestions. While developing hyperlayout, I tried a few different approaches, but the current implementation was the best one I came up with. Of course this doesn't mean that there isn't a better one. Feel free to come up with a new solution! 🙂 |
colinbate
commented
May 10, 2017
Fair enough. At the moment I feel frustrated by the lack of documentation around the Hyper APIs. :) I don't think the issue is with hyperlayout per se. Would it be possible for the plugin to do some of the work the command does? Reading the config files? |
iamstarkov
commented
Jun 14, 2017
this fix seems to solve problems on windows |
philoserf
commented
Jan 6, 2018
I see the project has drifted from the pull request. |

@timolins
This fixes Hyperlayout simply printing out config for me and gets Hyperlayout to work on Windows. 😄