Hi,
This is just a generic question on how you use Terminal and TextMate in developing with Rails. I benefit from the bundles like Ruby, Rails RubyAMP and RSpec. My problem is that I would like to have a few Terminal tabs open for one application. I need one tab for running commands like script/generate or rake tasks. (I know I can use Control- Shift-\ for some tasks, but it feels a bit slow to me.) Another tab is for the server log genarated after `script/server`. And optionally I have a tab open for script/console.
If I use Control-Shift-O, the Terminal window opens and `cd` to the current directory. RubyAMP bundle has Control-Command-P for a similar feature. But if I use the same command more than once, a new Terminal window shows up. I would like to have a new tab instead.
What I do currently is that: 1) Open the TextMate project file, 2) I use Control-Shift-O to open the Terminal window and find myself in the project directory, 3) run the AppleScript I made to duplicate a tab.
My AppleScript is written at <http://samuraicoder.net/applescript_duplicating_tabs_terminal
. This is just a shitty script, simply emulates what I do on
keyboards. Is there anybody who can know a much better way? Or would you suggest any better workflow?
Takaaki
On 5/17/08 5:33 AM, in article 7C526E24-F3CC-4E4C-BAE2-3E5BA5121FB0@samuraicoder.net, "Takaaki Kato" devlist@samuraicoder.net wrote:
script, simply emulates what I do on keyboards. Is there anybody who can know a much better way?
There is no better way, because the Terminal is not properly scriptable. Users should file a bug with Apple asking for a better way to manipulate tabs in the Terminal with AppleScript.
m.
On May 17, 2008, at 7:33 AM, Takaaki Kato wrote:
Is there anybody who can know a much better way? Or would you suggest any better workflow?
My suggestion doesn't really have anything to do with TextMate, but I strongly recommend that you look into GNU Screen. Here's a link that shows some basic usage:
http://gentoo-wiki.com/TIP_Using_screen
Essentially, screen allows you to setup your own tabs in just one terminal window, and much, much more.
James Edward Gray II
Hi,
Sorry for the late reply. I just found a screncast on "screen", which is a Unix utility James mentioned.
http://screencast.com/t/qIe86DMm
On May 18, 2008, at 12:33 AM, James Gray wrote:
On May 17, 2008, at 7:33 AM, Takaaki Kato wrote:
Is there anybody who can know a much better way? Or would you suggest any better workflow?
My suggestion doesn't really have anything to do with TextMate, but I strongly recommend that you look into GNU Screen. Here's a link that shows some basic usage:
http://gentoo-wiki.com/TIP_Using_screen
Essentially, screen allows you to setup your own tabs in just one terminal window, and much, much more.
James Edward Gray II
I made a command to open Terminal in a new tab. The applescript is a bit of a hack since, as was mentioned, Terminal is not properly scriptable. The command works for me, though YMMV. Best, Mark
On May 17, 2008, at 1:33 PM, Takaaki Kato wrote:
Hi,
This is just a generic question on how you use Terminal and TextMate in developing with Rails. I benefit from the bundles like Ruby, Rails RubyAMP and RSpec. My problem is that I would like to have a few Terminal tabs open for one application. I need one tab for running commands like script/generate or rake tasks. (I know I can use Control-Shift-\ for some tasks, but it feels a bit slow to me.) Another tab is for the server log genarated after `script/server`. And optionally I have a tab open for script/console.
If I use Control-Shift-O, the Terminal window opens and `cd` to the current directory. RubyAMP bundle has Control-Command-P for a similar feature. But if I use the same command more than once, a new Terminal window shows up. I would like to have a new tab instead.
What I do currently is that: 1) Open the TextMate project file, 2) I use Control-Shift-O to open the Terminal window and find myself in the project directory, 3) run the AppleScript I made to duplicate a tab.
My AppleScript is written at <http://samuraicoder.net/applescript_duplicating_tabs_terminal
. This is just a shitty script, simply emulates what I do on
keyboards. Is there anybody who can know a much better way? Or would you suggest any better workflow?
Takaaki
Takaaki Kato http://samuraicoder.net
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
On 17 May 2008, at 14:33, Takaaki Kato wrote:
[...] If I use Control-Shift-O, the Terminal window opens and `cd` to the current directory. RubyAMP bundle has Control-Command-P for a similar feature. But if I use the same command more than once, a new Terminal window shows up. I would like to have a new tab instead.
I saw a blog post (but lost the link) about a guy who had created shell aliases to change the directory to that of the frontmost TM document.
This is a slightly different workflow, i.e. switch to Terminal, do ⌘T and then “cdtm” or similar.
My AppleScript is written at <http://samuraicoder.net/applescript_duplicating_tabs_terminal
. This is just a shitty script, simply emulates what I do on
keyboards. Is there anybody who can know a much better way?
Here's the applescript I use in the ActionScript 3 Bundle to compile with:
http://pastie.textmate.org/pastes/198815
Essentially it locates - or creates if it doesn't exist - a tab in the terminal and writes to it. I also have a command which fetches the contents of the terminal window and pretty-prints the output.
The one problem is that it's Leopard only, as before that the Terminal wasn't properly scriptable.
Cheers, Simon