achiurizo / consular

Terminal automation
http://rdoc.info/github/achiu/consular/master/file/README.md
MIT License
813 stars 46 forks source link

Ability to add split panes in iTerm #61

Closed davidrapson closed 13 years ago

davidrapson commented 13 years ago

It would be awesome if there was a way of creating new split panes within iTerm 2 in addition to tabs. Something like the following would be cool but I feel it might be clobbering your lovely syntax.

tab :split => "vertically" do 
    pane "gitx"
    pane "ls" 
end 
achiurizo commented 13 years ago

hm, this seems useful. I'll have to look into this. If you liked to submit a patch, i'll be more than happy to accept =)

davidrapson commented 13 years ago

Hmm, looking at the docs and this issue it seems current AppleScript support in iTerm2 only covers windows and tabs, not split panes

LevelbossMike commented 13 years ago

I have found a way to split panes. Calling menu actions is possible with Applescript. I am currently working on integrating this with the terminitor dsl. The syntax is supposed to come down to this:

tab do
  pane run "gitx" # first pane
    pane do      # horizontal split
      run "ls"
    end
  pane run 'ls'   # vertical split
end

should result into something like this

    #    ###########################
    #    #            #            #
    #    #   'gitx'   #            #
    #    #            #            #
    #    #            #            #
    #    #            #            #
    #    ##############     'ls'   #
    #    #            #            #
    #    #            #            #
    #    #   'ls'     #            #
    #    #            #            #
    #    #            #            #
    #    ###########################

Everyone fine with that?

achiurizo commented 13 years ago

hm that loooks pretty good. i look forward to your patch!

LevelbossMike commented 13 years ago

I just pushed a working version to my forked repository. There is still some clean up in the code left to do, but it works as far as I am concerned.

I will clean it up and perhaps writes some test in the next few days and send a pull request after that. Please have a look at my fork and tell me if something is not working as it should be.

Thanks for this awesome project achiu!

Best regards, Mike

achiurizo commented 13 years ago

this feature has been pulled in and release thanks to @LevelbossMike. closing ticket!