commit b6df778a1cc6e790f2fec89c0daff6ac51c0f1e9 parent 2eeed553000a6c1453308e5e56f15f362e1ab599 Author: Suraj N. Kurapati <sunaku@gmail.com> Date: Tue, 29 May 2007 20:06:48 -0700 terminal shortcut now propogates working dir of current term into the new one Diffstat:
wmiirc-config.rb | | | 12 | +++++++++++- |
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/wmiirc-config.rb b/wmiirc-config.rb @@ -507,8 +507,18 @@ EOF # external programs + require 'fileutils' + + # Open a new terminal and set its working directory + # to be the same as the currently focused terminal. key Key::EXECUTE + 'x' do - system 'gnome-terminal &' + c = current_client + d = File.expand_path(c.label.read.sub(/^.*?:\s+/, '')) if c.exist? + d = ENV['HOME'] unless File.directory? d.to_s + + FileUtils.cd d do + system 'terminal &' + end end key Key::EXECUTE + 'k' do