Method: Consular::DSL#window

Defined in:
lib/consular/dsl.rb

#window(*args, &block) ⇒ Object

Run commands in the conext of a window.

Examples:

window 'my project', :size => [80, 30] do
  run 'ps aux'
end

Parameters:

  • args (Array)

    Hash to pass options to each context of a window. Each core can implement the desired behavior for the window based on the options set here. Can also pass a string as first parameter which will be set as the :name

  • block (Proc)

    block of commands to run in window context.



98
99
100
101
102
103
104
# File 'lib/consular/dsl.rb', line 98

def window(*args, &block)
  key            = "window#{@_windows.keys.size}"
  options        = args.extract_options!
  options[:name] = args.first unless args.empty?
  context = (@_windows[key] = window_hash.merge(:options => options))
  run_context context, &block
end