Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

The Run DTrace script in Terminal command works now

  • Loading branch information...
commit 5a563297628ecae09bc37d220b5579fdd51f9d4d 1 parent 5556053
@Machx authored
View
16 DTrace.tmbundle/Commands/Run Script in Terminal.tmCommand
@@ -7,6 +7,15 @@
<key>command</key>
<string>#!/bin/bash
+esc () {
+STR="$1" ruby &lt;&lt;"RUBY"
+ str = ENV['STR']
+ str = str.gsub(/'/, "'\\\\''")
+ str = str.gsub(/[\\"]/, '\\\\\\0')
+ print "'#{str}'"
+RUBY
+}
+
osascript &lt;&lt;- APPLESCRIPT
tell app "Terminal"
launch
@@ -14,11 +23,14 @@ osascript &lt;&lt;- APPLESCRIPT
do script "clear; sudo dtrace -s $(esc "${TM_FILEPATH}")"
set position of first window to { 100, 100 }
end tell
-APPLESCRIPT</string>
+APPLESCRIPT
+</string>
<key>input</key>
<string>document</string>
+ <key>keyEquivalent</key>
+ <string>@d</string>
<key>name</key>
- <string>Run Script in Terminal</string>
+ <string>Run DTrace Script in Terminal</string>
<key>output</key>
<string>discard</string>
<key>scope</key>
View
2  DTrace.tmbundle/info.plist
@@ -65,6 +65,8 @@
<dict>
<key>items</key>
<array>
+ <string>6A5498A0-2DC4-4FA7-85C8-512F7FF9555A</string>
+ <string>F677DA97-FEA5-4AFA-9189-EC66935FE1B3</string>
<string>7D575CB4-5E6E-4607-964F-1BFE18DD2F39</string>
<string>6DEFA5D8-8E95-4CEE-AD5D-D3D0E8FD7E63</string>
<string>A96A5D37-D2FD-4039-A234-0BD06A119C26</string>
View
10 README
@@ -1,16 +1,22 @@
This is a bundle for TextMate that adds the D Scripting language for DTrace and several useful DTrace scripts to TextMate. See the "Wiki" section at the top of the page for a more detailed explanation as to what works and what doesn't work right now.
-What's Changed since 1.0 Beta 2?
+What's Changed in 1.0 Beta 3?
+[NEW] Run Script in terminal works! This is very preliminary and works for scripts that don't have "$target" (ones where you would invoke the script with -p) eventually a mechanism will be added so you can specify a pid or select an App to trace before running
+[NEW] Entry & Return DTrace keywords and Tab Triggers
+
[FIX] Removed Redundant ustack() calls inside the Core Data Snippets
[FIX] One of the recently added DTrace providers still had boiler text there for some reason, changed this to the provider name
[FIX] Added the scope ( source.d ) to the newly added DTrace providers that were lacking any scope
[CHANGED] Changed "D Script" to just "D", screw the other D :P
-What's changed since 1.0 Beta 1?
+What's changed in 1.0 Beta 2?
[ADDED] List of DTrace Providers
+
[FIX] Target's Trigger (keyboard shortcut "\") has been removed
[FIX] "$target" instead of just "target" is recognized as a DTrace keyword
[FIX] Many snippets had "source.d," as the scope instead of just "source.d" which meant that the tab triggers extended into any TextMate Document
[FIX] Many DTrace keywords in the "More DTrace Keywords" had no scope, this has been changed to "source.d"
[CHANGED] D Script Language Keyboard Shortcut to avoid conflict with "Diff"
+Beta 1
+Initial release
Please sign in to comment.
Something went wrong with that request. Please try again.