hyperlayout icon indicating copy to clipboard operation
hyperlayout copied to clipboard

Add more robust method to retrieve config JSON from the terminal

Open stereokai opened this issue 7 years ago • 16 comments

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

stereokai avatar Dec 14 '16 13:12 stereokai

Awesome! Would be cool if you changed the variables from snake_case to camelCase to obey the linter. 🐫

timolins avatar Dec 14 '16 13:12 timolins

Thanks 🙏

timolins avatar Dec 14 '16 13:12 timolins

Green light

stereokai avatar Dec 14 '16 13:12 stereokai

This might sound weird, but your pull request basically killed my Hyper.app. 😅 crash

timolins avatar Dec 14 '16 21:12 timolins

:(

Maybe try to disable one or more of the regexes I introduced to discover the culprit?

stereokai avatar Dec 15 '16 07:12 stereokai

@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 avatar Dec 15 '16 08:12 stereokai

@timolins still there? :)

stereokai avatar Dec 19 '16 17:12 stereokai

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 avatar Dec 19 '16 18:12 timolins

And no, my command prompt doesn't print anything before it's ready for input.

timolins avatar Dec 21 '16 20:12 timolins

@timolins Did you try to disable one or more of the regexes I introduced to discover the culprit like I suggested? :)

stereokai avatar Dec 21 '16 21:12 stereokai

This code killed my Hyper too. It is the configMatcher which does it.

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 avatar May 10 '17 18:05 colinbate

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?

colinbate avatar May 10 '17 18:05 colinbate

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! 🙂

timolins avatar May 10 '17 19:05 timolins

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?

colinbate avatar May 10 '17 20:05 colinbate

this fix seems to solve problems on windows

iamstarkov avatar Jun 14 '17 11:06 iamstarkov

I see the project has drifted from the pull request.

philoserf avatar Jan 06 '18 06:01 philoserf