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

Commands only run for the last pane #129

Open
kirankunigiri opened this issue Sep 3, 2022 · 25 comments
Open

Commands only run for the last pane #129

kirankunigiri opened this issue Sep 3, 2022 · 25 comments

Comments

@kirankunigiri
Copy link

kirankunigiri commented Sep 3, 2022

I used one of the example yaml setups and tried a few commands. Only the last pane seems to actually run the command. If I use more than 3 panes, sometimes a few more will run but it seems random. I was originally using it to ssh into 3 different servers for each pane, but as a more simple example I am just running echo "Hello" for each pane. Only the last pane successfully executes the echo while nothing happens in the first two. The first two also don't cd into the correct directory.

I am using iTerm v3.3.7

My yaml file:

windows:
  - name: main-vertical
    root: /Users/kiran.kunigiri/Documents
    layout: double-main-horizontal
    panes:
      - echo "Hello1"
      - echo "Hello2"
      - echo "Hello3"

Result:
iTerm

@godbout
Copy link
Collaborator

godbout commented Sep 3, 2022

there's been issues with iTerm 3.3.x: #97

try updating to 3.4.x. haven't had any issue with those versions yet.

@godbout
Copy link
Collaborator

godbout commented Sep 3, 2022

best it to always use the latest version of iTerm: https://iterm2.com/version3.html

@godbout
Copy link
Collaborator

godbout commented Sep 3, 2022

and for reference, your yaml is good:

ScreenFlow.mp4

@kirankunigiri
Copy link
Author

I just updated to Build 3.4.16, but I'm still having the same issue.

@godbout
Copy link
Collaborator

godbout commented Sep 4, 2022

which version of iTermocil you're running? if it's the latest could it be possible that some zsh config or some other plugins (if you use oh-my-zsh etc.) are doing this? coz works fine on my side.

@Leeiio
Copy link

Leeiio commented Sep 6, 2022

same here.
iTermocil version is 1.0.3, iTerm2 version is 3.4.16.
My yaml file:

windows:
  - name: test
    root: ~
    layout: tiled
    panes:
      - commands:
          - ls
      - commands:
          - ls
      - commands:
          - ls
        focus: true
      - commands:
          - ls

2022-09-06 13 03 19

Everything is ok in last week.

@godbout
Copy link
Collaborator

godbout commented Sep 6, 2022

hmm. same. working fine here.

anything you did within the last week? updated macOS? python?

what version of macOS are you guys running? and python.

@kirankunigiri
Copy link
Author

I completely deleted and reset my zsh config but the same issue occurs.
macOS Monterey v12.5
python3 v3.10.6
iTerm v3.4.16

@godbout
Copy link
Collaborator

godbout commented Sep 6, 2022

@kirankunigiri what's your version of iTermocil? it's hard to help if we're not having the minimum info. even more while it works fine here.

i'm on Ventura beta. will try on Monterey later on.

@kirankunigiri
Copy link
Author

I just installed it, so I have the latest itermocil 1.0.3

@godbout
Copy link
Collaborator

godbout commented Sep 6, 2022

@kirankunigiri

can you try this yaml, just to make sure it's not related to some yaml structure? thanks.

windows:

  - name: code
    root: ~/Development/Wooshy/sources
    layout: even-vertical
    panes:
      - commands:
        - cd Core
        - clear
        - git status
        focus: true
      - commands:
        - cd AXEngine2
        - clear
        - git status
      - commands:
        - cd ../../AppCatalog
        - clear
        - git status
  - name: docs and site
    root: ~/Development/Wooshy
    layout: even-vertical
    panes:
      - commands:
        - cd docs
        - clear
        - git status
      - commands:
        - cd sites/wooshy
        - clear
        - git status

it's not gonna find the folders but it should still run the commands.

@kirankunigiri
Copy link
Author

Thanks, I tried it but it still has the same issue. The weird part is that as mentioned before, it's random. Sometimes none of the commands will run, while some other times 1 or 2 panes actually work and run the commands.

@kirankunigiri
Copy link
Author

kirankunigiri commented Sep 6, 2022

I also had ohmyzsh installed previously at some point, but already uninstalled it when I setup itermocil so there shouldn't be any conflict. The only other 2 plugins I have installed are Fig autocomplete and Starship, but I already tried making my .zshrc config empty and it still didn't work, unless they somehow affect iTerm even when not activated.

The only thing I can think of, and this is just a complete guess, is that maybe it is somehow a timing issue. The fact that it randomly works sometimes and not other times makes me think it's sometimes just sending the text command too early before zsh initializes, although I have no idea what is different on my system that is causing that.

@kirankunigiri
Copy link
Author

I went to my iTerm profile and changed the shell from zsh to bash, and itermocil works perfectly with bash. It looks like it's an issue with zsh not taking in the input correctly somehow.

@godbout
Copy link
Collaborator

godbout commented Sep 6, 2022

i've tried a new install on macOS 12.5 (21G72) and it works fine here. so yeah, doesn't seem to be an iTermocil issue. more some settings somewhere. where i don't know. zsh? iTerm? i'm just a user of iTermocil. no idea. works fine for me.

@kirankunigiri
Copy link
Author

kirankunigiri commented Sep 6, 2022

As a workaround, for anyone else with the same issue, I used this project instead (Didericis/itermp). Has similar features to itermocil but it works for me.
EDIT: This project also runs into the same issue for me

@godbout
Copy link
Collaborator

godbout commented Sep 6, 2022

I went to my iTerm profile and changed the shell from zsh to bash,

is this where you change from zsh to bash?

Screenshot 2022-09-06 at 18 40 04

@kirankunigiri
Copy link
Author

Yes, I changed that setting from "Login Shell" to "Command" and set it to "bin/bash" and it worked.

@godbout
Copy link
Collaborator

godbout commented Sep 6, 2022

strange. can't reproduce. i installed Starship, still working. emptied my zshrc etc. still working. zsh version? but we should have the same (5.8.1).

@kirankunigiri
Copy link
Author

Well this is weird, I just put everything back into my zshrc (fig and Starship) and now it's working with zsh! I have no idea why as I've tried doing this before already, but I hope it stays working. I'll report if it ever breaks again.

@godbout
Copy link
Collaborator

godbout commented Sep 7, 2022

I have no idea why

computers.

@kirankunigiri
Copy link
Author

kirankunigiri commented Sep 7, 2022

Well, it stopped working again. Looks like this truly is completely random madness haha (even the other project I previously linked also stopped working at the same time)
I'll probably try writing something from scratch using AppleScript or the iTerm python API, or worst case just automate the raw keypresses needed to get my windows and commands setup (which seems like the better choice at this point lol)

@godbout
Copy link
Collaborator

godbout commented Sep 7, 2022

(even the other project I previously linked also stopped working at the same time)

interesting. so definitely not an iTermocil issue. iTerm and zsh?

I'll probably try writing something from scratch using AppleScript or the iTerm python API, or worst case just automate the raw keypresses needed to get my windows and commands setup (which seems like the better choice at this point lol)

well hopefully you'll not get that issue 😬️
would be nice to find out what is happening tho.

@Aron-Polner
Copy link

Aron-Polner commented Oct 17, 2022

Having the same issues. I haven't used iTermocil in a while so hard to say what is causing the issue for me. I have however installed Fig since I used iTermocil last. Maybe that is causing the issues somehow?

iTermocil: 1.0.3
Python: 3.9.13
iTerm2: 3.4.16

@NickSchmitt
Copy link

@Aron-Polner Uninstalling Fig fixed the issue for me.

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

5 participants