Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add some split screen examples #2

Open
bpolaszek opened this issue Mar 30, 2020 · 43 comments
Open

Add some split screen examples #2

bpolaszek opened this issue Mar 30, 2020 · 43 comments

Comments

@bpolaszek
Copy link

Hello there,

That plugin looks awesome, but it lacks a little documentation on how to split the screen. For example, I have no idea on how I could separate the screen in 2 rows, 6 columns, to have 12 even sub-screens.

A more detailed example section would be very welcome, as that plugin sounds really promising!

Thank you,
Ben

@bet4it
Copy link
Owner

bet4it commented Mar 30, 2020

You should first split screen to your desired layout in tmux by C-a " and C-a %, then use command tmux list-windows -F "#{window_layout}" to get the layout string.

@bet4it
Copy link
Owner

bet4it commented Mar 30, 2020

Or you could try hyperlayout if all the panes have the same size.

@jedis00
Copy link

jedis00 commented Apr 23, 2020

Also have the same issue. Tried installing the sample in .hyperinator. It says it loads and does nothing. README vaguely mentions a .tmuxinator directory, but doesn't say what to do with it.

@bet4it
Copy link
Owner

bet4it commented Apr 23, 2020

@jedis00 Oh sorry, .tmuxinator is a typo and I will fix it later.
Post your config and I will check it for you.

@jedis00
Copy link

jedis00 commented Apr 23, 2020

@jedis00 Oh sorry, .tmuxinator is a typo and I will fix it later.
Post your config and I will check it for you.

It was a copy/paste of your advanced example into ~/.hyperinator/test.yml.

Loaded it and it said it loaded but the panes didn’t change. Restarting and doing a reload didn’t help.

@bet4it
Copy link
Owner

bet4it commented Apr 23, 2020

it said it loaded

What's the output?

@jedis00
Copy link

jedis00 commented Apr 23, 2020

@bet4it Output below. The other thing is, I'm using this on Windows 10. Hyperinator is using the deprecated path to hyper.js, looking in ~/hyper.js. That file is copied elsewhere and removed in the latest Hyper builds, so I had to create a symlink to get it to work within Git Bash...

jedis@local /d/files
$ npm install -g hyperinator
C:\Users\jedis\AppData\Roaming\npm\hyperinator -> C:\Users\jedis\AppData\Roaming\npm\node_modules\hyperinator\bin\hyperinator
C:\Users\jedis\AppData\Roaming\npm
--- [email protected]
+-- [email protected]
| --- [email protected]
+-- [email protected]
| +-- [email protected]
| | --- [email protected]
| --- [email protected]
--- [email protected]
jedis@local /d/files
$ hyper i hyperinator
hyperinator installed successfully!
jedis@local /d/files
$ mkdir ~/.hyperinator
jedis@local /d/files
$ nano ~/.hyperinator/test.yml
jedis@local /d/files
$ hyperinator load test
Can't find hyperinator plugin in ~/.hyper.js.
jedis@local /d/files
$ ln -s /c/Users/jedis/AppData/Roaming/Hyper/.hyper.js ~/.hyper.js
jedis@local /d/files
$ hyperinator load test
[hyperinator config]:C:\Users\jedis.hyperinator\test.yml

Contents of ~/.hyperinator/test.yml
start_directory: ~/
windows:

  • layout: e349,237x48,0,0{144x48,0,0,152,92x48,145,0[92x32,145,0,153,92x15,145,33,154]}
    panes:
    • shell_command:
      • echo 'Load demo layout!' > /tmp/test.txt
      • cat /tmp/test.txt
        focus: True
    • shell_command:
      • pwd
        start_directory: /tmp/
    • echo 'Hello world!'
      focus: True
  • layout: f8cc,237x48,0,0{164x48,0,0,152,72x48,165,0,153}
    panes:
    • shell_command:
      • emacs -nw
        focus: True
    start_directory: /etc

@jedis00
Copy link

jedis00 commented Apr 23, 2020

@bet4it I'd like to be able to have something like this restored when I launch Hyper:

https://i.imgur.com/ztsADpW.png

@bet4it
Copy link
Owner

bet4it commented Apr 25, 2020

@jedis00 I just published a new release, hyperinator should work on Windows now. Can you try it?
Remember to npm update -g hyperinator.
Your config:

windows:
- layout: 97b9,181x40,0,0{59x40,0,0,0,59x40,60,0[59x20,60,0,1,59x19,60,21,4],61x40,120,0[61x20,120,0,2,61x19,120,21,3]}
  panes:
  - echo '1'
  - echo '2'
  - echo '3'
  - echo '4'
  - echo '5'

@jedis00
Copy link

jedis00 commented Apr 27, 2020

@bet4it Thanks! I removed the binary and plugin and reinstalled. Still seeing the same thing. It says it loads, but the window stays the same. Tried a full reload and relaunched, but I still have the one pane. There aren't any errors, it just doesn't appear to do anything.

Mon Apr 27 2020  9:35:08 AM
jedis@local /d/files
$ hyperinator load multi
[hyperinator config: C:\Users\jedis\.hyperinator\multi.yml]

@jedis00
Copy link

jedis00 commented Apr 27, 2020

Found that this breaks CTRL+SHIFT+D to open a new pane. Gives a javascript error:

Uncaught exception: Error: Cannot create process, error code: 267 at new WindowsPtyAgent

If I close Hyper and relaunch without loading the config, CTRL+SHIFT+D works as expected.

@bet4it
Copy link
Owner

bet4it commented Apr 27, 2020

Oh that's a bit tricky.
I use Hyper on Win10 with bash.exe provided by Git-bash as default shell, and everything works fine.
I understand your problem. I'm not sure if that's because I installed windows-build-tools ( npm install --global windows-build-tools), it seems that it configured some terminal configs.
Are there any useful messages in Hyper's developer tools?
As for the error, do you install hypercwd?

@jedis00
Copy link

jedis00 commented Apr 27, 2020

@bet4it Same. Yes, I am using hypercwd, and it is setting my directory correctly when Hyper fires up Git Bash.

// for setting shell arguments (i.e. for using interactive shellArgs: ['-i']) // by default ['--login'] will be used shellArgs: ['--command=/usr/bin/bash.exe', '-l', '-i']

hypercwd: { initialWorkingDirectory: 'D:\\files' }

plugins: [ "hyper-search", "hyper-pane", "hypercwd", "hyper-systray", "hyper-save-windowstate", "hyperinator" ]

I ran the npm install --global windows-build-tools command and also updated npm to the latest stable version.

(re)loading renderer plugins
bundle.js:1 Plugin hyper-search (0.4.0) loaded.
bundle.js:1 Plugin hyper-pane (2.1.5) loaded.
bundle.js:1 Plugin hypercwd (1.4.0) loaded.
bundle.js:1 Plugin hyper-systray (1.0.0) loaded.
bundle.js:1 Plugin hyper-save-windowstate (1.0.5) loaded.
bundle.js:1 Plugin hyperinator (0.4.0) loaded.
C:\Users\jedis\AppData\Roaming\Hyper.hyper_plugins\node_modules\hyper-save-windowstate\electron-window-state.js:57 0 0 1920 1080
C:\Users\jedis\AppData\Roaming\Hyper.hyper_plugins\node_modules\hyper-save-windowstate\electron-window-state.js:58 430 414 1133 540
index.html:36 total init time 582.1049999999559

I commented out hypercwd, and CTRL+SHIFT+D does not give an error anymore. hyper-pane opens a new pane. But I am still not seeing any window layout from hyperinator. Should it take effect immediately after running hyperinator load multi -- filename is multi.yml.

@jedis00
Copy link

jedis00 commented Apr 27, 2020

Removed hyper-save-windowstate to make sure there wasn't a conflict... no change. Not seeing any window layout changes after loading my hyperinator config file.

@bet4it
Copy link
Owner

bet4it commented Apr 28, 2020

What about now? Hope I have fixed it.

@jedis00
Copy link

jedis00 commented Apr 28, 2020

@bet4it Nope. No change:

$ npm install -g hyperinator
C:\Users\jedis\AppData\Roaming\npm\hyperinator -> C:\Users\jedis\AppData\Roaming\npm\node_modules\hyperinator\bin\hyperinator
+ [email protected]
updated 1 package in 1.685s

$ hyperinator load multi
[hyperinator config: C:\Users\jedis\.hyperinator\multi.yml]
  
$

What is the behavior that is supposed to happen? Is the window supposed to instantly change after running the load command? Is it necessary to have to run that every time? It doesn't appear to save anything in .hyper.js for the config to know it needs to load that.

@bet4it
Copy link
Owner

bet4it commented Apr 28, 2020

win

@bet4it
Copy link
Owner

bet4it commented Apr 28, 2020

Could you edit C:\Users\jedis\AppData\Roaming\Hyper\.hyper_plugins\node_modules\hyperinator\index.js, apply this patch:

diff --git a/index.js b/index.js
index e34ec99..39d4a49 100644
--- a/index.js
+++ b/index.js
@@ -335,6 +335,9 @@ exports.middleware = store => next => action => {
 
   // Check for hyperinator config
   if (type === 'SESSION_ADD_DATA') {
+    if (data.includes('hyperinator')) {
+      console.log(data)
+    }
     const testedData = /\[hyperinator config: (.*)]/.exec(data.split(/\n/)[0])
     if (testedData && testedData[1]) {
       store.dispatch({

then run hyperinator and show me the result of Hyper's console?

@bet4it
Copy link
Owner

bet4it commented Apr 28, 2020

Which hyper version do you use, 3.0.2 or 3.1.0-canary?
Do you enable webGLRenderer in .hyper.js?

@jedis00
Copy link

jedis00 commented Apr 28, 2020

I'm using Hyper 3.1.0-canary.4 (stable) since there were issues with the version on their website and Windows 10. I don't have a setting for webGLRenderer in .hyper.js.

bundle.js:1 (re)loading renderer plugins
bundle.js:1 Plugin hyperinator (0.4.1) loaded.
index.html:36 total init time 332.67499999965366
C:\Users\jedis\AppData\Roaming\Hyper\.hyper_plugins\node_modules\hyperinator\index.js:339 �[?25l�[H�[156X�[156C
Tue Apr 28 2020 11:43:32 AM�[129X�[129C
jedis@local ~�[136X�[136C�[m
$ hyperinator load multi�[132X�[132C
�[156X�[156C
�[156X�[156C
�[156X�[156C
�[156X�[156C
�[156X�[156C
�[156X�[156C
�[156X�[156C
�[156X�[156C
�[156X�[156C
�[156X�[156C
�[156X�[156C
�[156X�[156C
�[156X�[156C
�[156X�[156C
�[156X�[156C
�[156X�[156C
�[156X�[156C
�[156X�[156C
�[156X�[156C
�[156X�[156C
�[156X�[156C
�[156X�[156C
�[156X�[156C
�[156X�[156C�[5;1H�[?25h�[?25l[hyperinator config: C:\Users\jedis\.hyperinator\multi.yml]
�[?25h
C:\Users\jedis\AppData\Roaming\Hyper\.hyper_plugins\node_modules\hyperinator\index.js:339 �[?25l�[H�[156X�[156C
Tue Apr 28 2020 11:43:32 AM�[129X�[129C
jedis@local ~�[136X�[136C�[m
$ hyperinator load multi�[132X�[132C
[hyperinator config: C:\Users\jedis\.hyperinator\multi.yml]�[95X�[95C
�[156X�[156C
�[156X�[156C
�[156X�[156C
�[156X�[156C
�[156X�[156C
�[156X�[156C
�[156X�[156C
�[156X�[156C
�[156X�[156C
�[156X�[156C
�[156X�[156C
�[156X�[156C
�[156X�[156C
�[156X�[156C
�[156X�[156C
�[156X�[156C
�[156X�[156C
�[156X�[156C
�[156X�[156C
�[156X�[156C
�[156X�[156C
�[156X�[156C
�[156X�[156C�[6;1H�[?25h�[?25l
Tue Apr 28 2020 11:43:38 AM
jedis@local ~�[m       
$�[26X�[26C�[9;3H�[?25h

@bet4it
Copy link
Owner

bet4it commented Apr 28, 2020

Could you give me a screenshot of the console?

@jedis00
Copy link

jedis00 commented Apr 28, 2020

https://i.imgur.com/Uk3IZxJ.png - extremely hard to read with the color codes.

@bet4it
Copy link
Owner

bet4it commented Apr 29, 2020

Oh, that's really weird. Why there is date displayed in the shell? Why there are some many control characters and colors? Do you use any custom bash configs? That's what the result looks like on my computer:

@bet4it
Copy link
Owner

bet4it commented Apr 29, 2020

What about this change:

diff --git a/index.js b/index.js
index e34ec99..ca0efb2 100644
--- a/index.js
+++ b/index.js
@@ -334,7 +334,10 @@ exports.middleware = store => next => action => {
   const {type, data, uid} = action
 
   // Check for hyperinator config
-  if (type === 'SESSION_ADD_DATA') {
+  if (type === 'SESSION_PTY_DATA') {
+    if (data.includes('hyperinator')) {
+      console.log(data)
+    }
     const testedData = /\[hyperinator config: (.*)]/.exec(data.split(/\n/)[0])
     if (testedData && testedData[1]) {
       store.dispatch({

If you still can't notice any changes, remove the .split(/\n/)[0]. There must be some changes of layout, though could not be correct.

@bet4it
Copy link
Owner

bet4it commented Apr 29, 2020

I guess hyperpower can't work on your environment.

@jedis00
Copy link

jedis00 commented Apr 29, 2020

Applied the second patch. Same stuff is being output to the console... but all of a sudden, it's working! Just tried it a second time, and sometimes it works and sometimes it doesn't. It says it loads, but nothing happens. If I run the command again, then it works sometimes.

Thank you so much for your help! :)

Would you be able to point me at what tool/setup you used to generate the window pane layouts? This is so exciting!

@bet4it
Copy link
Owner

bet4it commented Apr 29, 2020

The second patch is only a workaround and has a serious bug, you may find it if you close some windows.

It's better to tell me your bash config, so I may reproduce it on my computer. Otherwise it's impossible for me to fix it.

sometimes it works and sometimes it doesn't

I guess it may relate with terminal size?

Would you be able to point me at what tool/setup you used to generate the window pane layouts?

tmux

@jedis00
Copy link

jedis00 commented Apr 29, 2020

.bashrc
export PATH=$PATH:~/AppData/Local/hyper/app-3.1.0-canary4/resources/bin

.bash_profile

# generated by Git for Windows
test -f ~/.profile && . ~/.profile
test -f ~/.bashrc && . ~/.bashrc

~/.config/git/git-prompt.sh

if test -f /etc/profile.d/git-sdk.sh
then
    TITLEPREFIX=SDK-${MSYSTEM#MINGW}
else
    TITLEPREFIX=$MSYSTEM
fi

if [[ 1 == 1 ]];
then
    PS1='\[\033]0;$PWD\007\]' # set window title
    PS1='\[\033]0;$PWD\007\]' # set window title
    PS1="$PS1"'\n'                 # new line
    PS1="$PS1"'\[\033[35m\]\d \D{%Y %r}\n\]'
    PS1="$PS1"'\[\033[32m\]'       # change to green
    PS1="$PS1"'\u@\h '             # user@host<space>
    PS1="$PS1"'\[\033[33m\]'       # change to brownish yellow
    PS1="$PS1"'\w'                 # current working directory
    if test -z "$WINELOADERNOEXEC"
    then
        GIT_EXEC_PATH="$(git --exec-path 2>/dev/null)"
        COMPLETION_PATH="${GIT_EXEC_PATH%/libexec/git-core}"
        COMPLETION_PATH="${COMPLETION_PATH%/lib/git-core}"
        COMPLETION_PATH="$COMPLETION_PATH/share/git/completion"
        if test -f "$COMPLETION_PATH/git-prompt.sh"
        then
            . "$COMPLETION_PATH/git-completion.bash"
            . "$COMPLETION_PATH/git-prompt.sh"
            PS1="$PS1"'\[\033[36m\]'  # change color to cyan
            PS1="$PS1"'`__git_ps1`'   # bash function
        fi
    fi
    PS1="$PS1"'\[\033[0m\]'        # change color
    PS1="$PS1"'\n'                 # new line
    PS1="$PS1"'$ '                 # prompt: always $
fi

MSYS2_PS1="$PS1"               # for detection by MSYS2 SDK's bash.basrc

@bet4it
Copy link
Owner

bet4it commented Apr 29, 2020

What's the result of echo $PS1?

Could hyperinator work if you set PS1=$?

@jedis00
Copy link

jedis00 commented Apr 29, 2020

$ echo $PS1
\[\033]0;$PWD\007\]\n\[\033[35m\]\d \D{%Y %r}\n\]\[\033[32m\]\u@\h \[\033[33m\]\w\[\033[36m\]`__git_ps1`\[\033[0m\]\n$

@bet4it
Copy link
Owner

bet4it commented Apr 29, 2020

Can't reproduce. Give up🙃

@jedis00
Copy link

jedis00 commented Apr 29, 2020

I set PS1="$ " without overwriting anything. Had to run the load command three times in a row to get it to spawn the additional panes.

@bet4it
Copy link
Owner

bet4it commented Apr 29, 2020

With unmodified code?
What's the console output of first patch?

@jedis00
Copy link

jedis00 commented Apr 29, 2020

I'm back to the first patch. Same behavior with it working sometimes. I removed my custom git-prompt.sh and am using the default one from Git Bash with the default color coding. Here's the output in the console when it doesn't load.

Run load command and panes don't load:

jedis@local MINGW64 ~
$ hyperinator load multi
[hyperinator config: C:\Users\jedis\.hyperinator\multi.yml]

jedis@local MINGW64 ~
$
bundle.js:1 (re)loading renderer plugins
bundle.js:1 Plugin hyperinator (0.4.1) loaded.
index.html:36 total init time 369.3349999994098
C:\Users\jedis\AppData\Roaming\Hyper\.hyper_plugins\node_modules\hyperinator\index.js:339 �[?25l
�[?25h�[?25l�[3;3Hhyperinator load multi�[?25h
C:\Users\jedis\AppData\Roaming\Hyper\.hyper_plugins\node_modules\hyperinator\index.js:339 �[?25l�[H�[178X�[178C
jedis@local MINGW64 ~�[150X�[150C�[m
$ hyperinator load multi�[154X�[154C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C�[4;1H�[?25h�[?25l[hyperinator config: C:\Users\jedis\.hyperinator\multi.yml]
�[?25h
C:\Users\jedis\AppData\Roaming\Hyper\.hyper_plugins\node_modules\hyperinator\index.js:339 �[?25l�[H�[178X�[178C
jedis@local MINGW64 ~�[150X�[150C�[m
$ hyperinator load multi�[154X�[154C
[hyperinator config: C:\Users\jedis\.hyperinator\multi.yml]�[117X�[117C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C�[5;1H�[?25h�[?25l
jedis@local MINGW64 ~�[m
$�[27X�[27C�[7;3H�[?25h

Run command and panes do load:

jedis@local MINGW64 ~
$ hyperinator load multi

                                                      or\multi.yml]
                [hyperinator config: C:\Users\jedis\.hyperinator\multi.yml]

jedis@local MINGW64 ~
$  echo '1'
1

jedis@local MINGW64 ~
$
bundle.js:1 (re)loading renderer plugins
bundle.js:1 Plugin hyperinator (0.4.1) loaded.
index.html:36 total init time 301.4550000007148
C:\Users\jedis\AppData\Roaming\Hyper\.hyper_plugins\node_modules\hyperinator\index.js:339 �[?25l
�[?25h�[?25l�[3;3Hhyperinator load multi�[?25h
C:\Users\jedis\AppData\Roaming\Hyper\.hyper_plugins\node_modules\hyperinator\index.js:339 �[?25l�[H�[178X�[178C
jedis@local MINGW64 ~�[150X�[150C�[m
$ hyperinator load multi�[154X�[154C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C
�[178X�[178C�[4;1H�[?25h
C:\Users\jedis\AppData\Roaming\Hyper\.hyper_plugins\node_modules\hyperinator\index.js:339 �[?25l[hyperinator config: C:\Users\jedis\.hyperinator\multi.yml]
�[?25h
C:\Users\jedis\AppData\Roaming\Hyper\.hyper_plugins\node_modules\hyperinator\index.js:339 �[?25l�[H�[86X�[86C
jedis@local MINGW64 ~�[58X�[58C�[m
$ hyperinator load multi�[62X�[62C
�[86X�[86C
      [hyperinator config: C:\Users\jedis\.hyperinator\multi.yml]�[19X�[19C
�[86X�[86C
�[86X�[86C
�[86X�[86C
�[86X�[86C
�[86X�[86C
�[86X�[86C
�[86X�[86C
�[86X�[86C
�[86X�[86C
�[86X�[86C
�[86X�[86C
�[86X�[86C
�[86X�[86C
�[86X�[86C
�[86X�[86C
�[86X�[86C
�[86X�[86C
�[86X�[86C
�[86X�[86C
�[86X�[86C
�[86X�[86C
�[86X�[86C
�[86X�[86C
�[86X�[86C
�[86X�[86C
�[86X�[86C
�[86X�[86C
�[86X�[86C
�[86X�[86C
�[86X�[86C
�[86X�[86C
�[86X�[86C
�[86X�[86C
�[86X�[86C
�[86X�[86C
�[86X�[86C
�[86X�[86C�[6;1H�[?25h
C:\Users\jedis\AppData\Roaming\Hyper\.hyper_plugins\node_modules\hyperinator\index.js:339 �[?25l�[H�[86X�[86C
jedis@local MINGW64 ~�[58X�[58C�[m
$ hyperinator load multi�[62X�[62C
�[86X�[86C
      [hyperinator config: C:\Users\jedis\.hyperinator\multi.yml]�[19X�[19C
�[86X�[86C
�[86X�[86C
�[86X�[86C
�[86X�[86C
�[86X�[86C
�[86X�[86C
�[86X�[86C
�[86X�[86C
�[86X�[86C
�[86X�[86C
�[86X�[86C
�[86X�[86C
�[86X�[86C
�[86X�[86C
�[86X�[86C
�[86X�[86C
�[86X�[86C
�[86X�[86C
�[86X�[86C
�[86X�[86C
�[86X�[86C
�[86X�[86C
�[86X�[86C
�[86X�[86C
�[86X�[86C
�[86X�[86C
�[86X�[86C
�[86X�[86C
�[86X�[86C
�[86X�[86C
�[86X�[86C
�[86X�[86C
�[86X�[86C
�[86X�[86C
�[86X�[86C
�[86X�[86C
�[86X�[86C�[6;1H�[?25h�[?25l
jedis@local MINGW64 ~�[m
$  echo '1'�[17X�[17C
1�[27X�[27C
�[?25h
C:\Users\jedis\AppData\Roaming\Hyper\.hyper_plugins\node_modules\hyperinator\index.js:339 �[?25l�[H�[54X�[54C
jedis@local MINGW64 ~�[26X�[26C�[m
$ hyperinator load multi�[30X�[30C
�[54X�[54C
�[54X�[54C
                [hyperinator config: C:\Users\jedis\
.hyperinator\multi.yml]�[31X�[31C
�[54X�[54C
jedis@local MINGW64 ~�[26X�[26C�[m
$  echo '1'�[43X�[43C
1�[53X�[53C
�[54X�[54C
�[54X�[54C
�[54X�[54C
�[54X�[54C
�[54X�[54C
�[54X�[54C
�[54X�[54C
�[54X�[54C
�[54X�[54C
�[54X�[54C
�[54X�[54C
�[54X�[54C
�[54X�[54C
�[54X�[54C
�[54X�[54C
�[54X�[54C
�[54X�[54C
�[54X�[54C
�[54X�[54C
�[54X�[54C
�[54X�[54C
�[54X�[54C
�[54X�[54C
�[54X�[54C
�[54X�[54C
�[54X�[54C
�[54X�[54C
�[54X�[54C
�[54X�[54C
�[54X�[54C
�[54X�[54C�[12;1H�[?25h

@bet4it
Copy link
Owner

bet4it commented Apr 30, 2020

Can hyper's official plugin, hyperpower, work on your environment, and you can use wow command to switch the mode?

@bet4it
Copy link
Owner

bet4it commented Apr 30, 2020

What about this patch to C:\Users\jedis\AppData\Roaming\npm\node_modules\hyperinator\bin\hyperinator:

diff --git a/bin/hyperinator b/bin/hyperinator
index 29c0aef..023c346 100755
--- a/bin/hyperinator
+++ b/bin/hyperinator
@@ -25,7 +25,7 @@ const isPluginInstalled = (configPath) => {
 }
 
 
-function start() {
+async function start() {
   if (env.TERM_PROGRAM !== 'Hyper' && env.TERM_PROGRAM !== 'HyperTerm' && !env.HYPERINATOR) {
     console.error('You need to use Hyper.app to run this command')
     return
@@ -63,6 +63,7 @@ function start() {
         console.error(err)
         return
       }
+      await new Promise(r=>setTimeout(r, 1000))
       console.log(`[hyperinator config: ${cfgPath}]`)
       break
     default:

@jedis00
Copy link

jedis00 commented Apr 30, 2020

Hey there,

I have never tried hyperpower and am not familiar with the wow command. What would that test?

With the new patch, I've been able to get hyperinator to launch 10 times in a row successfully, with no issues. I've tried closing panes and rerunning it, and relaunching Hyper multiple times. It seems that might solve some kind of race condition? Definitely seems like it helped, since it hasn't failed yet!

@bet4it
Copy link
Owner

bet4it commented May 1, 2020

I think I have solved this problem finally.
But 1000 is too large. Could you help me figure out the minimal possible number? If it's small enough I can apply this patch to repository.

@jedis00
Copy link

jedis00 commented May 4, 2020

For sure! I'll try 500 and report back.

@jedis00
Copy link

jedis00 commented May 4, 2020

It seems to work reliably using 100 as the value.

One thing I can't figure out is, in the example you provided, how it decides which echo goes to which window. Is it spacing those out based on the delay to determine which pane it goes to?

Is it based on the unordered list in the config file? Anything in the first list goes to the first pane, etc.?

windows:
- layout: 97b9,181x40,0,0{59x40,0,0,0,59x40,60,0[59x20,60,0,1,59x19,60,21,4],61x40,120,0[61x20,120,0,2,61x19,120,21,3]}
  panes:
  - echo '1'
  - echo '2'
  - echo '3'
  - echo '4'
  - echo '5'

@bet4it
Copy link
Owner

bet4it commented May 4, 2020

Yeah, the order of these panes is deterministic and only depends on the layout.
For example, the pane in the upper left corner should always be the first pane.

You could calculate the order, but I think it's unnecessary. You could get the number of order by the output of echo once the layout is created.

@jedis00
Copy link

jedis00 commented May 4, 2020

Gotcha. Got tmux installed and played with it to make my own custom layout.

Any idea why when it runs a command specified in the yml, that it includes an extra blank line prompt after the command runs (ie, echo)?

@bet4it
Copy link
Owner

bet4it commented May 5, 2020

This behaviour was introduced in timolins/hyperlayout#17.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants