Skip to content

Commit

Permalink
adding title and size support.
Browse files Browse the repository at this point in the history
Note that in win32 cmd_core :bounds is [cols, rows].

window :name => 'my window', :bounds => [40,30] do
..
end
  • Loading branch information
jondot authored and achiurizo committed Apr 11, 2011
1 parent fc56b11 commit 34cbb28
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions lib/terminitor/cores/cmd_core/cmd_core.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,19 @@ def execute_command(cmd, options = {})
(options[:in] || current_window).send_command(cmd)
end

def open_tab(options = nil)
create_window
def open_tab(options = {})
create_window options
end

def open_window(options = nil)
create_window
def open_window(options = {})
create_window options
end

def create_window
WindowsConsole.new :name=>'cmd'
def create_window(options = {})
c = WindowsConsole.new :name=>'cmd'
c.send_command "title #{options[:name]}\n" if options[:name]
c.send_command "mode con: cols=#{options[:bounds][0]} lines=#{options[:bounds][1]}\n" if options[:bounds]
c
end
end
end
Expand Down

0 comments on commit 34cbb28

Please sign in to comment.