Identify syntax for highlighting using the shebang
Reported by Nicolás Sanguinetti | March 23rd, 2008 @ 04:42 AM
If I have a ruby script whose first line is
#!/usr/bin/env ruby
It should be colored as ruby.
Comments and changes to this ticket
-
Tom Preston-Werner March 23rd, 2008 @ 01:24 PM
- → State changed from new to open
-
Alex Coles March 23rd, 2008 @ 03:59 PM
This seems like a good idea, but I am presuming that you would want to see File Extension still take precedence?
I am also assuming you'd want to pattern match for occurrences of python / bash / sh / ruby, etc. -- to allow for absolute paths in shebangs - /usr/bin/binary /opt/local/bin
-
-
-
Dag Odenhall April 20th, 2008 @ 10:23 PM
This doesn't work with /usr/bin/env, or if there is whitespace between #! and the command.
-
-
defunkt April 20th, 2008 @ 11:03 PM
- → State changed from resolved to open
-
Thomas Aylott April 21st, 2008 @ 08:02 AM
This is already done in TextMate. You might want to check out the regex they use to match first-lines.
-
remi May 10th, 2008 @ 10:36 AM
As Dag said, doesn't work for `#! /bin/bash` or `#! /usr/bin/env ruby`
-
Alex Coles May 10th, 2008 @ 10:45 AM
Looks as though either a with or without a space after the shebang is
legal on most systems:
-
defunkt May 23rd, 2008 @ 08:49 AM
- → State changed from open to resolved
This should be fixed in the next deploy. Thanks.
Please Login or create a free account to add a new comment.
You can update this ticket by sending an email to from your email client. (help)
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
