Re: double-click on scripts behaviour

On Thu, 2004-04-29 at 21:38, Christophe Fergeau wrote:
> Hi,
> Because of the switch to shared mime info, when the user double clicks
> on an executable shell (or python, or perl) script, the dialog asking
> whether the user wants to edit it, or run it is no longer displayed.
> This happens because nautilus displays this dialog when it encounters a
> text/xxx executable file, but in the shared mime database, most scripts
> have an application/xxx mime type.
> The attached patch special cases the various scripts mime types I could
> find so that the dialog properly appears, but I'm not sure hard coding
> these mime types in nautilus is the best way to do that. Maybe the
> various scripts should be moved from application/xxx to test/xxx in the
> shared mime database (incidentally, there's already a text/x-ksh for ksh
> scripts, this should be made consistent with the other scripts mime
> types somehow).
> Thoughts?
> Christophe

Hi there,

Could Nautilus check if the first two characters of the file are '#!'
(these indicate to the operating system that the file is a script)?
Since final checks for mimetype are done by sniffing already, it
shouldn't hurt to do this test as well. It would also avoid having to
define special cases for all script mime types.

Just an idea.

Peter Harvey.
Mostly Quiet.

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]