Using TextMate 1.5.1 (948), I've observed some behavior that I wasn't expecting. Specifically, when I set the command's input to Entire Document, my command seems to get less than the entire document on its stdin.
I'm curious whether anyone else is seeing the same thing. Here's an easy way to test.
Create a new command (MyCommand) with the following settings:
Save: Nothing Command(s): cat Input: Entire Document Output: Create New Document.
Unless I'm missing something, this command should simply copy the command's input, the entire document, to a new document, using the shell "cat" command. However, the command's input seems to begin at the character immediately following the first ) character in the document. If there is no ) in the document, nothing is copied.
I don't know if there is something specific to my environment that may be causing it, or if it's a bug, but this behavior wreaks havoc with the built-in Ruby "Run Script" command (which uses cat), causing it to overwrite saved Ruby source files with less than their full content.
--David W. Body / Big Creek Software, LLC
On 12 Apr 2006, at 01:59, David W.Body wrote:
Using TextMate 1.5.1 (948), I've observed some behavior that I wasn't expecting. Specifically, when I set the command's input to Entire Document, my command seems to get less than the entire document on its stdin.
I'm curious whether anyone else is seeing the same thing. Here's an easy way to test.
Create a new command (MyCommand) with the following settings:
Save: Nothing Command(s): cat Input: Entire Document Output: Create New Document.
I just tried it out. It worked for me. I am using TM 961 though. Best, Mark
On Apr 11, 2006, at 7:59 PM, David W.Body wrote:
Unless I'm missing something, this command should simply copy the command's input, the entire document, to a new document, using the shell "cat" command. However, the command's input seems to begin at the character immediately following the first ) character in the document. If there is no ) in the document, nothing is copied.
It works fine over here. Can you give us an example? What happens if you use "cat -" instead of "cat"?
--David W. Body / Big Creek Software, LLC
Haris
On Apr 11, 2006, at 9:10 PM, Allan Odgaard wrote:
On 12/4/2006, at 2:59, David W.Body wrote:
I don't know if there is something specific to my environment that may be causing it [...]
Try put #!/bin/sh at the top of the command, i.e. making it:
#!/bin/sh cat
This will skip all the usual shell startup stuff.
That fixes the behavior. Any idea what might be the underlying cause, or where I should start looking?
On 12/4/2006, at 13:49, David W. Body wrote:
[...] That fixes the behavior. Any idea what might be the underlying cause, or where I should start looking?
This page descibes the shell startup [1], so that would be what to look through. I.e. your ~/.profile, ~/.bash_profile etc.
Some of it must running something which reads from stdin or similar.
[1] http://macromates.com/textmate/manual/shell_commands#search_path
On Apr 12, 2006, at 11:25 AM, Allan Odgaard wrote:
On 12/4/2006, at 13:49, David W. Body wrote:
[...] That fixes the behavior. Any idea what might be the underlying cause, or where I should start looking?
This page descibes the shell startup [1], so that would be what to look through. I.e. your ~/.profile, ~/.bash_profile etc.
Some of it must running something which reads from stdin or similar.
[1] http://macromates.com/textmate/manual/shell_commands#search_path
The culprit appears to be ssh-agent, which is started in my ~/.bash_profile.
Thanks, Allan and the others who replied.