Giter VIP home page Giter VIP logo

itermocil's Introduction

Introduction

iTermocil allows you to setup pre-configured layouts of windows and panes in iTerm2, having each open in a specified directory and execute specified commands. You do this by writing YAML files to save your layouts. If you're using session restoration or saved window layouts in iTerm, you should find iTermocil is a nice upgrade on that.

iTermocil supports iTerm 2.x and the new 3.x (including later betas). It works better with the new 3.x versions which have improved Applescript support.

Example

Installing iTermocil

# Install `itermocil` via Homebrew
$ brew update
$ brew install TomAnthony/brews/itermocil

# Create your layout directory
$ mkdir ~/.itermocil

# Edit ~/.itermocil/sample.yml (look for sample layouts in this very `README.md`)
# There are also a variety of example files in 'test_layouts' directory in this repo
$ itermocil --edit sample

# Run your newly-created sample layout
$ itermocil sample

# Note that you can also used ~/.teamocil as your directory, if you're a teamocil user.

Using iTermocil

$ itermocil [options] <layout-name>

Alternatively, if you have an iTermocil.yml file in the current directory you can simply run itermocil and it will use that file, so you can have files inside your projects and sync via Github etc:

$ cd my_project
$ itermocil

iTermocil is compatible with all of teamocil's flags, and they all work in the same way.

Global options

Option Description
--list Lists all available layouts in ~/.itermocil

Layout options

Option Description
--layout Takes a custom file path to a YAML layout file instead of [layout-name]
--here Uses the current window as the layout’s first window
--edit Edit the layout file in either $EDITOR or your preferred GUI editor
--show Shows the layout content instead of executing it

Configuration

Session

Key Description
name This is currently ignored in iTermocil as there is no tmux session.
windows An Array of windows
pre Command that get executes before all other actions.

Windows

Key Description
name All iTerm panes in this window will be given this name.
root The path where all panes in the window will be started
layout The layout format that iTermocil will use (see below)
panes An Array of panes
command A command to run in the current window. Ignored if panes is present
commands An array of commands for run in the current window. Ignored if either panes or command is present
focus This is currently unsupported in iTermocil

Panes

A pane can either be a String or a Hash. If it’s a String, Teamocil will treat it as a single-command pane.

Key Description
commands An Array of commands that will be ran when the pane is created
focus If set to true, the pane will be selected after the layout has been executed

Examples

See some example of various layouts below, or see Layouts for more information on the available layouts. There is also a variety of example layout files in this repo.

Simple two pane window

windows:
  - name: sample-two-panes
    root: ~/Code/sample/www
    layout: even-horizontal
    panes:
      - git status
      - rails server
.------------------.------------------.
| (0)              | (1)              |
|                  |                  |
|                  |                  |
|                  |                  |
|                  |                  |
|                  |                  |
|                  |                  |
|                  |                  |
|                  |                  |
'------------------'------------------'

Simple three pane window

windows:
  - name: sample-three-panes
    root: ~/Code/sample/www
    layout: main-vertical
    panes:
      - vim
      - commands:
        - git pull
        - git status
        name: 'git'
      - rails server

Note: the 'name' directive in 'commands' in an iTermocil specific addition, which will cause teamocil to fail if it tries to parse the file.

.------------------.------------------.
| (0)              | (1)              |
|                  |                  |
|                  |                  |
|                  |                  |
|                  |------------------|
|                  | (2)              |
|                  |                  |
|                  |                  |
|                  |                  |
'------------------'------------------'

Simple three pane window (flipped)

windows:
  - name: sample-three-panes
    root: ~/Code/sample/www
    layout: main-vertical-flipped
    panes:
      - commands:
        - git pull
        - git status
      - rails server
      - vim
.------------------.------------------.
| (0)              | (2)              |
|                  |                  |
|                  |                  |
|                  |                  |
|------------------|                  |
| (1)              |                  |
|                  |                  |
|                  |                  |
|                  |                  |
'------------------'------------------'

Simple four pane window

windows:
  - name: sample-four-panes
    root: ~/Code/sample/www
    layout: tiled
    panes:
      - vim
      - foreman start web
      - git status
      - foreman start worker
.------------------.------------------.
| (0)              | (1)              |
|                  |                  |
|                  |                  |
|                  |                  |
|------------------|------------------|
| (2)              | (3)              |
|                  |                  |
|                  |                  |
|                  |                  |
'------------------'------------------'

Two pane window with focus in second pane

windows:
  - name: sample-two-panes
    root: ~/Code/sample/www
    layout: even-horizontal
    panes:
      - rails server
      - commands:
          - rails console
        focus: true
.------------------.------------------.
| (0)              | (1) <focus here> |
|                  |                  |
|                  |                  |
|                  |                  |
|                  |                  |
|                  |                  |
|                  |                  |
|                  |                  |
|                  |                  |
'------------------'------------------'

A pane-less window

windows:
  - name: pane-less
    root: ~/Code/sample/www
    command: rails console
  - name: one_more-pane-less
    root: ~/Code/sample/www
    commands:
      - bundle update
      - rails server

Additional Layouts

In the Layouts file you can see these additional layouts:

  • 3_columns - 3 columns with as many rows as needed
  • double-main-vertical - 2 left full height columns, and a third multi-row column
  • double-main-horizontal - 2 rows, where bottom row is 2 full width columns, and top row is multi-column

teamocil

iTermocil was originally inspired by and is compatible with teamocil, allowing anyone with teamocil files to execute those files natively in iTerm2, without needing tmux or any other dependency. However, iTermocil also has support for additional directives which will cause teamocil to fail, if used.

Notes

Teamocil allows supplying a name for a tmux session which has no purpose in iTerm, and so that option is ignored.

In tmux it is 'windows' that have names, whereas in iTerm each pane in a window can have a name. iTermocil will name all the child panes of a window by the window name given in a termocil file.

iTermocil works for iTerm 2+, but the script support is better in iTerm 2.9 beta so things run a bit faster/cleaner with iTerm 2.9+. If using beta builds you should grab the latest nightly, as the 2.9.20150626 'recommended beta' build does not have the required script hooks for iTermocil to work (and I have no plans to kludge something just for an incomplete beta that will never be released).

Starting with version 1.0.0, iTermocil uses Python3. If you need iTermocil for Python2, please use 0.2.1.

Shell autocompletion

Zsh autocompletion

To get autocompletion when typing itermocil <Tab> in a zsh session, add this line to your ~/.zshrc file:

compctl -g '~/.itermocil/*(:t:r)' itermocil

Bash autocompletion

To get autocompletion when typing itermocil <Tab> in a bash session, add this line to your ~/.bashrc file:

complete -W "$(itermocil --list)" itermocil

fish autocompletion

To get autocompletion when typing itermocil <Tab> in a fish session, add this line to your ~/.config/fish/config.fish file:

complete -c itermocil -a "(itermocil --list)"

Contributors

I'd love any ideas/feedback/thoughts, please open an issue or create a fork and send a pull request, like these wonderful people:

A huge thanks to Rémi Prévost who authored teamocil, which inspired iTermocil. It is a fantastic tool, and I'm hoping that iTermocil helps more people discover teamocil.

To Do

  • make a way to 'save' the current layout (not sure is possible)
  • add tmuxinator file support
  • add support for bespoke file format to support things like iTerm badges and tab colours
  • possibly add a flag for using windows instead of tabs for new 'windows'
  • pane 'focus' is supported, but window 'focus' is not yet - I'm not sure how to focus on a certain window still
  • with the --edit flag, if no $EDITOR is set and a new layout name is given, then an empty file is created to be opened in a GUI editor. Is there a better way to handle this? Maybe clean up blank files whenever itermocil is launched?

License

iTermocil is © 2016 Tom Anthony and may be freely distributed under the MIT license. See the LICENSE file for more information.

itermocil's People

Contributors

febley avatar godbout avatar jefftriplett avatar johnathanweisner avatar mattmartini avatar mbollemeijer avatar mcky avatar onthestairs avatar rebeling avatar ruudk avatar tomanthony avatar zach-nervana avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

itermocil's Issues

How to create a new window?

The terminology for this library makes the use of "window" confusing. I want to spin up a separate, detached window, not a new tab (which this library refers to as a "window"). Is this possible?

Expected end of line but found class name

With the new beta version of Iterm I get the following erorr.

47:53: syntax error: Expected end of line but found class name. (-2741)

windows:
   - name: projectName
     root: ~/dev/repos/projectName
     layout: main-vertical
     panes:
       - commands:
         - . ./setantenv.sh
         - ant clean
         - ant all
         - ./startHybris-osx.sh debug
         name: Hybris server
       - commands:
         - git status
         name: 'git'
       - git fetch origin`

Pane-less window malfunctions

The following iTermocil config:

windows:
  - name: test
    root: ~
    command: echo 'hello'

results in the following output:

Last login: Tue May  2 13:35:58 on ttys019
e; c; h; o;  ; '; h; e; l; l; o; '
<compname>:~ <username>$ e; c; h; o;  ; '; h; e; l; l; o; '
-bash: syntax error near unexpected token `;'
<compname>:~ <username>$

It seems I am unable to open a pane-less window.

$ itermocil --version
0.2.1

.itermocil.yml

Hi,

iTermocil.yml might not be viewable other than the project's own files. This is a common way of storing configuration data as you know from the libraries like, for example, .babelrc, .nvmrc, .eslint.rc.js, .gitignore etc.

I think that renaming that file to .itermocil.yml would be more user friendly.

What do you think?

What do you think about arbitrary layouts

I would like to implement something like this:

layout: h-1-2
would interpret each number as rows of column

*******************************
|                        |                             |
|                        *****************
|                        |                             |  
*******************************

layout: v-2-1
would interpret each number as columns of row

*******************************
|                        |                             |
*******************************
|                                                      |  
*******************************

What do you think?

python errors

$ itermocil sample
Traceback (most recent call last):
  File "/usr/local/Cellar/itermocil/0.1.5/libexec/bin/itermocil", line 124, in <module>
    instance = Itermocil(filepath, here=args.here, cwd=cwd)
  File "/usr/local/Cellar/itermocil/0.1.5/libexec/bin/itermocil.py", line 73, in __init__
    self.process_file()
  File "/usr/local/Cellar/itermocil/0.1.5/libexec/bin/itermocil.py", line 375, in process_file
    for num, window in enumerate(teamocil_config['windows']):
KeyError: 'windows'

iTerm Build 2.1.1

Runs each command on all panes

Installed latest version of itermocil (0.1.8) and iTerm2 (2.1.4) with following project

windows:
  - name: sample
    root: ~
    layout: main-vertical-flipped
    panes:
       - echo "1"   
       - echo "2"
       - echo "3"

Here is output, notice all commands are executed on all panes:
screen shot 2016-02-04 at 11 55 09 am

Using iTerm's profile

I've already set up a bunch of profiles in iTerm2 (pane name, badge, ssh command, colors, font, and etc.), and would like to reuse this profile by specifying in itermocil's yaml file. Is this possible?

itermocil fails when it checks iTerm build compiled from sources

Hi! I have iTerm, which were compiled from git master branch and itermocil fails b/c build number is not int (it contains git string).

Traceback (most recent call last):
  File "/usr/local/Cellar/itermocil/0.1.8/libexec/bin/itermocil", line 6, in <module>
    main()
  File "/usr/local/Cellar/itermocil/0.1.8/libexec/bin/itermocil.py", line 687, in main
    instance = Itermocil(filepath, here=args.here, cwd=cwd)
  File "/usr/local/Cellar/itermocil/0.1.8/libexec/bin/itermocil.py", line 38, in __init__
    if (int(build) < 20150805):
ValueError: invalid literal for int() with base 10: 'git'

Launch your iTermocil layout files in 1-click.

I've hacked together an Automator app which handles iTermocil layout files (named as *.itermocil), so you can launch it only by clicking it (no need to be in iTerm as it will open a new terminal).

Really handy for launching whole projects (servers, browsers, finder, etc.) in 1-click.

Here's how to use it: http://tilyoumake.it/things/momentum/.
Happy to see how this could be improved.

Execution error

itermocil has broken for me and I'm not sure why. I occasionally run a system update command, that's all I can think of which has changed since it was working.

# alec at Alec's MacBook in ~ [13:01:00]
→ itermocil dotfiles
201:235: execution error: iTerm got an error: Can’t make «class » id 24060 into type specifier. (-1700)

I've tried uninstalling/reinstalling itermocil, and cutting down my ~/.itermocil directory to just one small file, still no dice.

itermocil --list still successfully displays my files, but when I launch one a new tab opens (where I would expect to see the commands run) with nothing and the previous tab contains the above error.

Running iTerm2 3.0.20160722-nightly

SSH

Hey Tom, great app!

I'm trying to run my commands starting with an SSH into a remote box. then from there, change directories and eventually run a top or tail a log file.

so my YML file is something like this:

windows:
  - name: Test
    root: ~/
    layout: even-horizontal
    panes:
      - commands:
        - ssh username@host
        - sudo su - someotheruser
        - tail -f somefile
      - commands:
        - ssh username@host
        - sudo su - someotheruser
        - top

Though the 2nd and 3rd command execute on my shell before SSH'ing into the remote box. Now I understand why this would be tricky, though is there a way to do this?

Can't find iTerm version

Itermocil version: 0.1.8
iTerm version: Build 2.9.20160313
Python version: 2.7.10
OS X version: 10.11.2 (15C50)

When trying to start with the "even-horizontal" sample I get the following error:

$ itermocil sample
26:33: execution error: Can’t get application "iTerm". (-1728)
Traceback (most recent call last):
  File "/usr/local/Cellar/itermocil/0.1.8/libexec/bin/itermocil", line 6, in <module>
    main()
  File "/usr/local/Cellar/itermocil/0.1.8/libexec/bin/itermocil.py", line 687, in main
    instance = Itermocil(filepath, here=args.here, cwd=cwd)
  File "/usr/local/Cellar/itermocil/0.1.8/libexec/bin/itermocil.py", line 28, in __init__
    major_version = self.get_major_version()
  File "/usr/local/Cellar/itermocil/0.1.8/libexec/bin/itermocil.py", line 95, in get_major_version
    return float(v[:3])
ValueError: could not convert string to float:

This happens for whichever layout I've tried.
My theory is that the function "get_version_string" can't find the iTerm application:

 $ osascript -e 'get version of application "iTerm"'
 4:11: execution error: Can’t get application "iTerm". (-1728)
 $ osascript -e 'get version of application "iTerm2"'
 2.9.20160313

I don't remember installing iTerm in a different way than mentioned on iTerms website, and I only have one iTerm installed (#35).

When manually trying to edit the itermocil.py with the above change I get:

47:53: syntax error: Expected end of line but found class name. (-2741)

But I don't have more time to put on this right now. Hope this helps

Expected end of line but found class name

I wish to open 10 tiled terminals. When I try to do so I receive the following error:

2871:2878: syntax error: Expected end of line but found class name. (-2741)

My yml file looks like this:

windows:
  - name: my_servers
    root: ~/some_important_server_directory/
    layout: tiled
    panes:
      - ssh <server 0>
      - ssh <server 1>
      - ssh <server 2>
      - ssh <server 3>
      - ssh <server 4>
      - ssh <server 5>
      - ssh <server 6>
      - ssh <server 7>
      - ssh <server 8>
      - ssh <server 9>

Feature request: check cwd for itermocil file

Just dropped a config file into our projects git repo but running itermocil --layout itermocil.yml --here isn't ideal, it'd be nice to be able to drop it into the root like a .gitignore or .editorconfig

It'd be cool if it was possible to fallback to a check for a file in the current directory if nothing is found in the users root. I'm not a python dev but I can give a shot at a PR to be reviewed if you think it's worthwhile.

Thoughts?

Unexpected behavior when using more than one `window`

Configuration:

windows:
 - name: backend
   root: ~/dev/backend/projectname
   layout: even-horizontal
   panes:
     - commands:
       - vagrant up
       - vagrant ssh
     - charm .

 - name: frontend
   root: ~/dev/frontend/projectname
   layout: main-vertical-flipped
   panes:
     - webpack
     - npm start
     - commands:
       - charm .
       focus: true

What happens:

  • first window gets loaded as it should
  • second window only has it's first pane loaded

When I load both windows in each their own config file and calling itermocil backend; itermocil frontend I get this error:

424:478: execution error: iTerm got an error: Can’t get session 4 of current terminal. Invalid index. (-1719)

But when I run itermocil backend and itermocil frontend separately it works as expected.

Broken itermocil after 0.1.6 update

When updating my brew packages itermocil was bumped to 0.1.6. I'm now receiving this every time I open my terminal or attempt to run itermocil:

Traceback (most recent call last):
  File "/usr/local/Cellar/itermocil/0.1.6/libexec/bin/itermocil", line 3, in <module>
    from itermocil import main
  File "/usr/local/Cellar/itermocil/0.1.6/libexec/bin/itermocil.py", line 8, in <module>
    import yaml
ImportError: No module named yaml

Any ideas? My ~/.teamocil folder remains unchanged after the upgrade.

Maybe isn't working for nighlys of iterm2?

I had some issues that docker-machine didn't support my latest iterm2 because the api had changed. Maybe this is a similar issue:

docker-archive/toolbox#81 (comment)

~ ❯❯❯ itermocil test                                                                                                                                                     ⏎
Traceback (most recent call last):
  File "/usr/local/Cellar/itermocil/0.1.8/libexec/bin/itermocil", line 6, in <module>
    main()
  File "/usr/local/Cellar/itermocil/0.1.8/libexec/bin/itermocil.py", line 687, in main
    instance = Itermocil(filepath, here=args.here, cwd=cwd)
  File "/usr/local/Cellar/itermocil/0.1.8/libexec/bin/itermocil.py", line 69, in __init__
    self.process_file()
  File "/usr/local/Cellar/itermocil/0.1.8/libexec/bin/itermocil.py", line 528, in process_file
    self.arrange_panes(len(window['panes']), layout)
KeyError: 'panes'

I'm on Build 2.9.20151006-nightly.

The config is as simple as this:

~ ❯❯❯ cat .teamocil/test.yml                                                                                                                                             ⏎
windows:
  - name: test
    root: ~/
    layout: tiled
    commands:
      - pwd
~ ❯❯❯

How to assign a keyboard shortcut?

When creating saved window arrangements with iTerm2, you can assign a keyboard shortcut to launch a predefined layout of windows/splits etc. I like this library but don't want to have to type a command to do this.

Issue installing

I get the following error when trying to install:

 ~> brew install TomAnthony/brews/itermocil
==> Tapping TomAnthony/brews
Cloning into '/usr/local/Library/Taps/tomanthony/homebrew-brews'...
remote: Counting objects: 9, done.
remote: Compressing objects: 100% (6/6), done.
remote: Total 9 (delta 1), reused 9 (delta 1), pack-reused 0
Unpacking objects: 100% (9/9), done.
Checking connectivity... done.
Tapped 1 formula (31 files, 128K)
Error: undefined method `desc' for Formulary::Formulae::Itermocil:Class
Please report this bug:
    https://git.io/brew-troubleshooting
/usr/local/Library/Taps/tomanthony/homebrew-brews/Formula/itermocil.rb:2:in `<class:Itermocil>'
/usr/local/Library/Taps/tomanthony/homebrew-brews/Formula/itermocil.rb:1:in `load_file'
/usr/local/Library/Homebrew/formulary.rb:92:in `module_eval'
/usr/local/Library/Homebrew/formulary.rb:92:in `load_file'
/usr/local/Library/Homebrew/formulary.rb:82:in `klass'
/usr/local/Library/Homebrew/formulary.rb:71:in `get_formula'
/usr/local/Library/Homebrew/formulary.rb:177:in `get_formula'
/usr/local/Library/Homebrew/formulary.rb:200:in `factory'
/usr/local/Library/Homebrew/extend/ARGV.rb:16:in `block in formulae'
/usr/local/Library/Homebrew/extend/ARGV.rb:16:in `map'
/usr/local/Library/Homebrew/extend/ARGV.rb:16:in `formulae'
/usr/local/Library/Homebrew/cmd/install.rb:41:in `install'
/usr/local/Library/brew.rb:140:in `<main>

Paneless windows not working

I just installed iTermocil and your layout examples in README.md work fine, all but the last one "A paneless window".

windows:
  - name: pane-less
    root: ~/Code/sample/www
    command: rails console
windows:
  - name: one_more-pane-less
    root: ~/Code/sample/www
    commands:
      - bundle update
      - rails server

If I put that code into a paneless.yml file and run itermocil paneless, it just opens one tab with the window defined last (one_more-pane-less) and runs its commands, but it completely ignores the first one (pane-less).

I really wanted to have one my_big_project.yml file where I define several windows to be opened in several tabs (some of them will be split in panels, others won't). Isn't that possible?

itermocil launch fails when broadcast input is enabled

If i run itermocil when i have broadcast input, the launch fails and i have to close the windows, disable broadcast input, run itermocil again, and re-enable broadcast input. The itermocil application should be able to gracefully handle the broadcast input toggle (e.g., check for it, and temporarily disable it when launching the layout).

Use the cwd as root for relative paths

It would be awesome if you were to use itermocil in a directory, that all roots specified as relative paths (or if omitted) would be relative to the current working directory.

windows:
  - root: some-api
  ...
  - root: other-api
~/Projects/my-company> $ itermocil

Waiting

Is there a way to have one pane wait for another to finish before executing? My use case is around launching boot2docker and then once the VM is up running containers.

It's hard to find a layout matching my needs

A great project! The thing I was looking for, thanks, @TomAnthony and contributors.

I wanted to use a layout like this:

image

It's good for watching background scripts and having a focused bottom window for git.

Since I didn't find this layout in the readme.md, I had to try one by one layouts form the test-layouts/ directory to came up with layout: tiled

What's the better way to find a layout I need?

Make layouts act as templates

Hi! Discussion issue about extend layouts functionality so they can accept args and params passed from the CLI (example taken from tmuxinator).

itermocil node-app my-project root=~/Dev/my-project
.itermocil/
  |-- node-app.yml
windows:
  - name: <%= @args[0] %>         # `my-project` will be used
    root: <%= @params['root'] %>  # `~/Dev/my-project` will be used
    layout: tiled
    panes:
      - atom .
      - git status
      - npm start

iTerm 3.0.3 Can’t make "window-1" into type integer. (-1700)

Heh, saw the change in the iterm update changelog, but couldn't resist :)

The error is:

140:176: execution error: iTerm got an error: Can’t make "window-1" into type integer. (-1700)

And the changelog message was something like (couldn't find a link to it, sorry):

Return a real window.ID (integer) rather than a string

Thanks, really appreciate itermocil :)

itermocil opening layout in a new tab

I don't know if the expected behaviour but i think this is really "annoying"

I'm using this layout:

windows:
  - name: sample-3-columns
    root: ~/Projects/Website
    layout: 3_columns
    panes:
      - echo "bla"
      - echo "bla"
      - echo "bla"
      - echo "bla"

Is it because a iTerm option or something like this?

iTerm2 creates tabs not layout

A buddy of mine recommended this application to me, but I am having a slight issue. When I try to build layouts it creates tabs in iterm 2 and does not split the windows. Thoughts?

Occur error when update iterm2 to Build 3.0.0

After upgrading the iterm2 to version Build 3.0.0, it will occur error when I execute itermocil:
Below is the error detail:

26:33: execution error: 無法取得「application "iTerm"」。 (-1728)
Traceback (most recent call last):
File "/usr/local/Cellar/itermocil/0.1.8/libexec/bin/itermocil", line 6, in
main()
File "/usr/local/Cellar/itermocil/0.1.8/libexec/bin/itermocil.py", line 687, in main
instance = Itermocil(filepath, here=args.here, cwd=cwd)
File "/usr/local/Cellar/itermocil/0.1.8/libexec/bin/itermocil.py", line 28, in init
major_version = self.get_major_version()
File "/usr/local/Cellar/itermocil/0.1.8/libexec/bin/itermocil.py", line 95, in get_major_version
return float(v[:3])
ValueError: could not convert string to float:

Please help me to solve this problem, thx.

can you support item2 version 3.0.0

When i upgrade my iterm2 to 3.0.0, the itermocil not word any more.
The error shows:

This is an unsupported beta build of iTerm.
Try the latest nightly, or the 2.1.1 stable build.
See Readme notes for more info. Sorry!

Can you make your itermocil support iterm2 3.0.0?

4 columns?

Has anyone worked on a 4 or 5 column layout?

Great!

No issue; just wanted to say that your project is great :). Using it every day.

Not working right after install

Hi, I installed itermocil, but for any attempt to run a layout, I get the following:

➜  ~  itermocil sample
304:311: syntax error: Expected end of line but found class name. (-2741)

Debug info (if helps):

➜  ~  itermocil sample --debug

tell application "iTerm"
    activate
    delay 0.3
    tell i term application "System Events" to keystroke "t" using command down
    delay 0.3
    tell i term application "System Events" to keystroke "d" using command down
    tell i term application "System Events" to keystroke "]" using command down
    delay 2

    tell twelfth session of current terminal
        write text "cd ~/Code/sample/www; git status"
        set name to "sample-two-panes"
    end tell

    tell thirteenth session of current terminal
        write text "cd ~/Code/sample/www; rails server"
        set name to "sample-two-panes"
    end tell
end tell
➜  ~  brew info itermocil
tomanthony/brews/itermocil: stable 0.1.5
https://github.com/TomAnthony/itermocil
/usr/local/Cellar/itermocil/0.1.5 (48 files, 744K) *
  Built from source
From: https://github.com/tomanthony/homebrew-brews/blob/master/Formula/itermocil.rb

I'm on OS X 10.10.4 with iTerm2 2.1.1

tiled not working as it should?

Hi,

I do not think the commando tiled work as it should or I am miss understand the function.

If I try the example:

windows:

  • name: _tiled_4_panes
    root: ~
    layout: tiled
    panes:
    • echo "pane 1"
    • echo "pane 2"
    • echo "pane 3"
    • echo "pane 4"

I get this result:
image

It should be like this ?

image

Specs:
iTerm2 build 2.1.4
brew list itermocil
/usr/local/Cellar/itermocil/0.1.7/bin/itermocil
/usr/local/Cellar/itermocil/0.1.7/bin/itermocil.py
/usr/local/Cellar/itermocil/0.1.7/libexec/bin/ (3 files)
/usr/local/Cellar/itermocil/0.1.7/libexec/vendor/ (38 files)

Python version compatibility

Great stuff! I have been looking for something to define/automate/version control iTerm layouts! Thank you!

Since I am not using Homebrew, I tried to install via pip. That itself works flawlessly, but I could not use the itermocil command right away, as upon the first test execution I were receiving a stack trace pointing at the invalid syntax for print usage (missing parentheses). Then I realised that I have Python 3.5, and it seems that your script is meant for Python 2.7.

It could have saved me some time and headache if Python version support would have been stated in the docs. It might be useful to add.

Support for 2/3 size Panes etc?

I've just picked up this tool, seems to work nicely, thanks! Is there any way to set up a layout with two panes, one being 2/3rds the width of a window, and the next one third? Looking at the source code and browsing through the iTerm docs I couldn't quickly find anything that would allow setting widths by ratio or pixels

Timing problem with tabs in iTerm 2.1.1

Hey, this looks like a great script! I tend run commands in multiple tabs rather than panes. Do you think tab manipulation could be added to itermocil? I think it would be a good addition as you already have all that AppleScript machinery in place.

The layout file could perhaps look like

windows:
  - name: blah
    tabs:
      - root: ~
        layout: even-horizontal
        panes:
          - echo "pane 1"
          - echo "pane 2"

syntax error: Expected end of line but found class name. (-2741)

I have updated the brew installation to v0.2.1 to support iTerm2 3.0 but I am getting error running what seems to be a really simple panel setup.

Here is my setup

10:19:27 ~$ itermocil --show work
windows:
  - name: myserver
    root: ~/
    command: ssh myserver
10:21:05 ~$ itermocil work
163:169: syntax error: Expected end of line but found class name. (-2741)

I am just trying to test the water before building my entire config but kept running into this issue.

I just realized another issue after closing all my iTerm2's and trying again. This time it opens up an iTerm session. I don't understand why it is trying to open up iTerm instead of using the running iTerm2.

10:26:10 ~$ itermocil work
47:53: syntax error: Expected end of line but found class name. (-2741)

Reverse version of main-horizontal and main-vertical

First off, I have to say that I love itermocil so far! My only gripe is that I wish there was a "reverse" version of the main-vertical and main-horizontal layouts. Something akin the below example would be amazing:

.------------------.------------------.
| (0)              | (2)              |
|                  |                  |
|                  |                  |
|                  |                  |
|------------------|                  |
| (1)              |                  |
|                  |                  |
|                  |                  |
|                  |                  |
'------------------'------------------'

Now that being said, I did take a look at the code to see if this was possible so I might try my hand at implementing it in PR myself.

Cheers

Colors per pane

I wonder - is there a way to set the color per pane?

Also along the same lines - is there a way to specify the profile per pane?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.