Hi,
Recently I wrote a bundle command to paste the selected TM text to a terminal window.
Was working fine for few weeks, but then suddenly there was a lag of 2-3 seconds between when i launched the command (via bundles menu or keyboard shortcut) and when it got around to pasting the text. Kind of irritating.
THoughts?
---------------
rawText="$(cat | sed 's/ / /g;')"
# send the code to the Terminal osascript -e 'on run(theCode)' \ -e ' tell application "Terminal"' \ -e ' do script theCode in window 1' \ -e ' end tell' \ -e 'end run' -- "$rawText"
On 6 Oct 2009, at 15:55, bean22 wrote:
Recently I wrote a bundle command to paste the selected TM text to a terminal window.
Was working fine for few weeks, but then suddenly there was a lag of 2-3 seconds between when i launched the command (via bundles menu or keyboard shortcut) and when it got around to pasting the text. Kind of irritating.
See second item at http://wiki.macromates.com/Troubleshooting/ShellCommands
Try insert: ‘#!/bin/sh’ as first line of your command. This may function as a workaround.
Hmmmm
I think this might be something else
as executing
/usr/libexec/path_helper -s
is almost instantaneous, while running my little bundle command still takes a few seconds.
On Oct 7, 2009, at 5:05 AM, Allan Odgaard wrote:
On 6 Oct 2009, at 15:55, bean22 wrote:
Recently I wrote a bundle command to paste the selected TM text to a terminal window.
Was working fine for few weeks, but then suddenly there was a lag of 2-3 seconds between when i launched the command (via bundles menu or keyboard shortcut) and when it got around to pasting the text. Kind of irritating.
See second item at http://wiki.macromates.com/Troubleshooting/ShellCommands
Try insert: ‘#!/bin/sh’ as first line of your command. This may function as a workaround.
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
The running time of path_helper depends on the value of PATH.
Did you try my suggestion?
On 7 Oct 2009, at 12:17, Brian Mandell wrote:
Hmmmm
I think this might be something else
as executing
/usr/libexec/path_helper -s
is almost instantaneous, while running my little bundle command still takes a few seconds.
On Oct 7, 2009, at 5:05 AM, Allan Odgaard wrote:
On 6 Oct 2009, at 15:55, bean22 wrote:
Recently I wrote a bundle command to paste the selected TM text to a terminal window.
Was working fine for few weeks, but then suddenly there was a lag of 2-3 seconds between when i launched the command (via bundles menu or keyboard shortcut) and when it got around to pasting the text. Kind of irritating.
See second item at http://wiki.macromates.com/Troubleshooting/ShellCommands
Try insert: ‘#!/bin/sh’ as first line of your command. This may function as a workaround.
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
yep - no dice.
put in the first line of the command
reloaded the bundle and restarted TM
but still the delay
On Oct 7, 2009, at 7:59 AM, Allan Odgaard wrote:
The running time of path_helper depends on the value of PATH.
Did you try my suggestion?
On 7 Oct 2009, at 12:17, Brian Mandell wrote:
Hmmmm
I think this might be something else
as executing
/usr/libexec/path_helper -s
is almost instantaneous, while running my little bundle command still takes a few seconds.
On Oct 7, 2009, at 5:05 AM, Allan Odgaard wrote:
On 6 Oct 2009, at 15:55, bean22 wrote:
Recently I wrote a bundle command to paste the selected TM text to a terminal window.
Was working fine for few weeks, but then suddenly there was a lag of 2-3 seconds between when i launched the command (via bundles menu or keyboard shortcut) and when it got around to pasting the text. Kind of irritating.
See second item at http://wiki.macromates.com/Troubleshooting/ShellCommands
Try insert: ‘#!/bin/sh’ as first line of your command. This may function as a workaround.
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
On Wed, Oct 7, 2009 at 8:11 AM, Brian Mandell mandellb@gmail.com wrote:
yep - no dice.
put in the first line of the command
reloaded the bundle and restarted TM
but still the delay
Try from the terminal:
$ touch "$HOME/Library/Application Support/TextMate/bash_init.sh"
(Of course, '$' represents your shell prompt.) Keep in mind your bundle commands will no longer have your shell environment, but in my case, I don't want them to. Remove bash_init.sh if this doesn't fix the problem.
j.
On Wed, Oct 7, 2009 at 7:42 AM, Jay Soffian jaysoffian@gmail.com wrote:
On Wed, Oct 7, 2009 at 8:11 AM, Brian Mandell mandellb@gmail.com wrote:
yep - no dice.
put in the first line of the command
reloaded the bundle and restarted TM
but still the delay
Try from the terminal:
$ touch "$HOME/Library/Application Support/TextMate/bash_init.sh"
(Of course, '$' represents your shell prompt.) Keep in mind your bundle commands will no longer have your shell environment, but in my case, I don't want them to. Remove bash_init.sh if this doesn't fix the problem.
Brian, first off, that's a sweet bundle command. Very clever. I wonder if it's just applescript where the delay is occurring. Have you executed it outside of textmate to check if it's not the case?
Sorry if my little blurb is more noise pollution than help.
Tim
Alas-
Tried touching, deleting bash_init.sh, no luck.
Then went ahead and took tim's suggestion - runs very slow in the terminal, too, so it must be applescript. Time to look for another way.
Thanks all for your time!
On 8 Oct 2009, at 02:39, bean22 wrote:
Then went ahead and took tim's suggestion - runs very slow in the terminal, too, so it must be applescript. Time to look for another way.
You indicated the problem was new. Perhaps this is related to installed scripting additions being loaded by osascript? This could be indirectly, e.g. I think 1Passwd now does their stuff via a scripting addition.
Interesting -
turns out I remembered it working because it still does - on my other computer, which has snow leopard.
my main computer still has leopard, and has the delay...
same version of textmate
same bundle code
Allan Odgaard-4 wrote:
On 8 Oct 2009, at 02:39, bean22 wrote:
Then went ahead and took tim's suggestion - runs very slow in the terminal, too, so it must be applescript. Time to look for another way.
You indicated the problem was new. Perhaps this is related to installed scripting additions being loaded by osascript? This could be indirectly, e.g. I think 1Passwd now does their stuff via a scripting addition.
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
You can use ‘sample’ to get a sample of what osascript does (or maybe Shark).
That might help you find out what is causing the problem. AFAIK osascript does scan lots of scripting dictionaries and load scripting additions when it is launched, so likely your problem is with some of that. Maybe it is trying to load a scripting dictionary from /Network/ Library/… and rather than immidiately fail, there is a timeout because the OS tries to automount some previously seen drive, etc. (probably not this exact issue, but I have seen problems like that).
On 10 Oct 2009, at 04:49, bean22 wrote:
Interesting -
turns out I remembered it working because it still does - on my other computer, which has snow leopard.
my main computer still has leopard, and has the delay...
same version of textmate
same bundle code
Allan Odgaard-4 wrote:
On 8 Oct 2009, at 02:39, bean22 wrote:
Then went ahead and took tim's suggestion - runs very slow in the terminal, too, so it must be applescript. Time to look for another way.
You indicated the problem was new. Perhaps this is related to installed scripting additions being loaded by osascript? This could be indirectly, e.g. I think 1Passwd now does their stuff via a scripting addition.
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
-- View this message in context: http://www.nabble.com/Textmate-bundle-command-delay-tp25769214p25830513.html Sent from the textmate users mailing list archive at Nabble.com.
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate