How to open a new tab with the same current directory in a terminal?

I use the following script to open a new terminal with the same pwd.
I'm wondering how to modify it to open a new tab with the same pwd.
#!/bin/sh
# Open a new terminal in the cwd
CWD=`pwd`
osascript<<END
set thePath to "$CWD"
set myPath to (POSIX file thePath as alias)
try
tell application "Terminal"
activate
do script with command "cd \"" & thePath & "\""
end tell
end try
END

bit of a hack, but the make command doesn't seem to work for tabs in terminal. replace what's currently in the 'try' block with this code:
tell application "Terminal" to activate
tell application "System Events"
tell process "Terminal"
keystroke "t" using command down
end tell
end tell
tell application "Terminal"
do script "cd " & (quoted form of thePath) in last tab of window 1
end tell

Similar Messages

  • When I search for something, firefox opens a new tab with the results. How can I change the settings to where it will all stay in the same tab?

    When I search something Firefox automatically opens a new tab with the results of this search. How do I change the settings to where the results will appear in the same tab as where I conducted the search?

    Whether to open search results in new window most often is a setting of the search engine you are using.

  • How can I open a new window with the same website like the one I have open?

    In safari I can open a new window with the same website like the one I have open, that makes it easy continuing to navigate on a website and to go back to the original website

    Hello Andieas
    Why open a new window for fast browsing??
    Open new tabs.
    Just right click on what you want to open and click "Open in new Tab"
    It is easy and doesn't consume memory from your computer as well as easy to navigate.
    Hope you'll like it

  • My safari stopped letting me open a new tab in the same window. what happened and how can I get it back to normal?

    When I try and open a new tab in the same window, it wont open a new tab. It leaves the page I am on and goes to the "top sites page."

    Hi,
    If you have got to  Mountain Lion OS X 10.8.2 and therefore Messages version 7.0.1 then double click the individual chats.
    Once they are in separate windows you can chat like that  (That's the way I used to chat - I didn't even use the tabbed chat)
    It is impossible to create a separate Chat window each new chat (you have to separate them off from the main window which also keeps a "copy")
    New chats are added to the main window even if you have used the red button to hide it. (CMD + 0 from the Window menu brings it back)
    10:49 PM      Tuesday; November 20, 2012
    Please, if posting Logs, do not post any Log info after the line "Binary Images for iChat"
      iMac 2.5Ghz 5i 2011 (Mountain Lion 10.8.2)
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb (Snow Leopard 10.6.8)
     Mac OS X (10.6.8),
     Couple of iPhones and an iPad
    "Limit the Logs to the Bits above Binary Images."  No, Seriously

  • I forgot the answer to the security questions and i forgot the email i put there to resend the link so i can change it. i want to close my apple ID and open a new one with the same email could i?

    i forgot the answer to the security questions and i forgot the email i put there to resend the link so i can change it. i want to close my apple ID and open a new one with the same email could i?

    i live in saudi arabia and i tried calling them and letting them call me but they said that it is unable to my country. ***** i don't know what to do!

  • Can't open a new tab with the + for tabs. Can open with Mid mouse button. Nightly.

    When I click The + to open a new tab in Nightly, it does nothing. I can open new tabs with mid ouse button, or right click>open in new tab. Just cant open a new tab via the + button. Started 3 updates ago in nightly (3 days ago pretty much).

    Are you using a 32 bit Nightly build or a 64 bit Nightly build?
    The 64 bit Nightly build for Windows is only generated to test for compilation errors and doesn't undergo all the tests that other builds get, so the risk that something goes wrong can be quite high.<br />
    So if you do use the 64 bit version then try the 32 bit version to see if you still have this problem.
    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance).
    *Do NOT click the Reset button on the Safe Mode start window.
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes
    Create a new profile as a test to check if your current profile is causing the problems.
    See "Creating a profile":
    *https://support.mozilla.org/kb/profile-manager-create-and-remove-firefox-profiles
    *http://kb.mozillazine.org/Standard_diagnostic_-_Firefox#Profile_issues
    If the new profile works then you can transfer some files from an existing profile to the new profile, but be cautious not to copy corrupted files to avoid carrying over the problem.
    *http://kb.mozillazine.org/Transferring_data_to_a_new_profile_-_Firefox

  • How to open a new iView in the same window?

    Hi
      i want to open a new iview in the same window.How can i do that ?
    Thanks

    Hi,
    If u want to code in WDJ  ..
    Use following method
         WDPortalNavigation.navigateAbsolute(
         "ROLES://<PCD location>,
         WDPortalNavigationMode.SHOW_INPLACE,               WDPortalNavigationHistoryMode.ALLOW_DUPLICATIONS,
         (String) null  );
    SHOW_INPLACE is the key
    Cheers!!
    Ashutosh

  • I can't seem to open a new tab with the keyboard shortcut or the plus sign thing next to an already open tab to open another one. Does anyone know how to fix this problem?

    This didn't happen until yesterday night after I updated to Firefox 3.6. So now I have to resort to right clicking then choosing to open a new tab from there.

    That can a problem with the Ask<i></i>.com toolbar (Tools > Add-ons > Extensions)
    See:
    * [[Troubleshooting extensions and themes]]

  • Why can't I open a new Tab with the "Plus" sign or "Command-T"?

    If I want to open a New Tab, I either press "Command T" or select "New Tab" from the File menu, or click the little "plus" sign in my Tabs bar - - - right? None of them work. What am I missing?

    This problem in is Firefox on your Mac?
    May users have discovered this problem is caused by Conduit add-ons, such as a Conduit plugin and/or a "Community Toolbar" extension.
    You can check for and disable extensions on the Add-ons page. Either:
    * Command+Shift+a
    * "3-bar" menu button (or Tools menu) > Add-ons
    In the left column, click Extensions. Then, if in doubt, disable.
    Often a link will appear above at least one disabled extension to restart Firefox. You can complete your work on the tab and click one of the links as the last step.
    Does that help with the "+" button? If so, could you name the specific extension that caused the problem?
    You might also check the Plugins section of the Add-ons page. You can use "Never Activate" to disable plugins that you don't ordinarily use.

  • Why firefox in my desktop can't open a new tab in the same windows?

    I can't open a new tab by clicking the + symbol. I don't know why this happen. If I want to open a new tab, I have to take a right click and then choosing open new tab. I think this is so terrible, I can't access the page on the same windows.

    Uninstall the '''''Ask Toolbar'''''. It can cause that problem.
    *http://support.mozilla.com/en-US/kb/Uninstalling+add-ons
    *http://support.mozilla.com/en-US/kb/Cannot%20uninstall%20an%20add-on
    *http://kb.mozillazine.org/Uninstalling_toolbars
    If that does not solve your problem:
    *See --> [http://support.mozilla.com/en-US/kb/Troubleshooting+extensions+and+themes Troubleshooting extensions and themes]
    *See --> [http://support.mozilla.com/en-US/kb/Troubleshooting+plugins Troubleshooting plugins]
    *See --> [http://support.mozilla.com/en-US/kb/Basic+Troubleshooting Basic Troubleshooting]
    '''If this reply solves your problem, please click "Solved It" next to this reply when <u>signed-in</u> to the forum.'''
    Not related to your question, but...
    You may need to update some plug-ins. Check your plug-ins and update as necessary:
    *Plug-in check --> http://www.mozilla.org/en-US/plugincheck/
    *Adobe Shockwave for Director Netscape plug-in: [https://support.mozilla.com/en-US/kb/Using%20the%20Shockwave%20plugin%20with%20Firefox#w_installing-shockwave Installing ('''''or Updating''''') the Shockwave plugin with Firefox]
    *'''''Adobe PDF Plug-In For Firefox and Netscape''''': [https://support.mozilla.com/en-US/kb/Using%20the%20Adobe%20Reader%20plugin%20with%20Firefox#w_installing-and-updating-adobe-reader Installing/Updating Adobe Reader in Firefox]
    *'''''Shockwave Flash''''' (Adobe Flash or Flash): [https://support.mozilla.com/en-US/kb/Managing%20the%20Flash%20plugin#w_updating-flash Updating Flash in Firefox]
    *Next Generation Java Plug-in for Mozilla browsers: [https://support.mozilla.com/en-US/kb/Using%20the%20Java%20plugin%20with%20Firefox#w_installing-or-updating-java Installing or Updating Java in Firefox]

  • Why can't I open a new tab for the same website? Want to disable 'switch to tab'.

    I used to be able to open multiple tabs for the same website on Firefox 3.xx. I could download files from one tab and work from another. How can I disable the 'switch to tab' function?

    You can disable it by using the Switch to Tab no more add-on - https://addons.mozilla.org/firefox/addon/switch-to-tab-no-more

  • I am not able to open a new tab in the same window.

    I was able to opennew tabs in the same window but now I am unable to do it

    hello, can you try to replicate this behaviour when you launch firefox in safe mode once? if not, maybe an addon is interfering here...
    [[Troubleshoot extensions, themes and hardware acceleration issues to solve common Firefox problems]]

  • When opening a new tab with the middle click, it at-times jumps to the new tab when I set it not to

    I have already made sure that the option to switch to new tab is unticked. Please help

    Hello bump, help please.

  • I opened a new project with the same name as an existing project and it deleted my existing

    Bad day on my part. I spent all day recording a song with Garageband. As I finished it, I exported it to iTunes (Thank God), closed garage band and listened to the song. Hearing that it had several seconds at the beginning that were silence and not edited out I opened a new Garageband project under the same project name as the previous one and it erased everything the previous project had. Leaving me with no file. No project. No memory of the initial project. Any clues or am I SOL?

    SchilbAaron wrote:
    I opened a new Garageband project under the same project name as the previous one
    the OS should have asked if you wanted to replace the old file with this one. if it did not, perhaps you saved this file in a different folder and the old one still exists? You could try a spotlight search on your entire hard drive to see if both files exist.
    if you did replace the old with the new, the only real hope is that you have a backup (perhaps you use Time Machine?)
    SchilbAaron wrote:
    Hearing that it had several seconds at the beginning that were silence and not edited out[...]  am I SOL?
    if that's the _only_ issue, not completely out of luck. you could drop the audio file back into a new GB project and export an exact length:
    http://www.bulletsandbones.com/GB/GBFAQ.html#exportexactlength
    (Let the page FULLY load. The link to your answer is at the top of your screen)
    Note: if you compressed the export (mp3/acc) you'll be double compressing the file and losing a lot of musical information, but it may be better than losing a One-Time piece of work.
    an alternate method would be to use an Audio Editor to cut out the silence. i'm not sure that this would save any quality, i think you'll still be double compressing the file, but it's something else to try, and listen to, to make a decision on which is better:
    http://www.bulletsandbones.com/GB/GBFAQ.html#audioeditors
    (Let the page FULLY load. The link to your answer is at the top of your screen)

  • When I click the home button firefox switches to the home page, but also opens a new tab with the firefox startup page.

    This is so annoying. I wind up with a bunch of extra tabs that I have to close.

    Make sure that you haven't set multiple home pages, separated by a pipe (|) symbol.
    See these articles for some suggestions:
    *https://support.mozilla.org/kb/Firefox+has+just+updated+tab+shows+each+time+you+start+Firefox
    *https://support.mozilla.org/kb/How+to+set+the+home+page - Firefox supports multiple home pages separated by '|' symbols
    *http://kb.mozillazine.org/Preferences_not_saved

Maybe you are looking for

  • Safari will only load if connected via LAN line, not wifi.

    My safari hangs when I try to connect to it via wifi, firefox works fine. I have just got Lion to see if that would fix it but it hasn't, cleared cache and reset numerous times. I cannot get software updates via aifi either, it says I am not connecte

  • Adobe Flash Plugin

    About maybe 4-11 times a day my Adobe Flash Plugin keeps crashing. For some reason is causes my cursor to get stuck or freeze, making me unable to do/click anything. I have to keep shutting down my computer and turning it back on, and 15 mins later i

  • How can I fix Classic?

    writing in for a friend....has an iMac G3 400MHz OS 10.2. bought the computer used, came with no cds, books or anything. downloaded yahoo messenger but can't get it to run. error message comes up "there is no volume with a system folder that supports

  • Opening .zip file that computer thinks is "in use"

    I recently found an external hard drive from many years ago what contained lots of old interesting stuff. One of the files (a .zip file) was gray. I was able to transfer it from the external drive to my laptop, but it remained gray. When I double cli

  • How can i download hindi songs for free

    how can i download hindi songs for free ? pawan +91-9911447274