From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 83068 invoked by alias); 9 May 2017 06:17:32 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 81907 invoked by uid 89); 9 May 2017 06:17:31 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy=completion, environmental, ruby, fe X-HELO: mail-wr0-f172.google.com Received: from mail-wr0-f172.google.com (HELO mail-wr0-f172.google.com) (209.85.128.172) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 09 May 2017 06:17:29 +0000 Received: by mail-wr0-f172.google.com with SMTP id l9so60748543wre.1 for ; Mon, 08 May 2017 23:17:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=F79Ba95CDcu9Sim8uBfOUTgR8vsnsQ3wtrz1dUlzC6s=; b=RQY7GmT2uew1jnq/k22v+51oARoQOkD6qpL54KNys0kmtKj1SAQSmC2pNziiLbaNjH gf70Fm0YStYYYk7FSkp4p+ga4uiqYpKP+RjNx9GmerA7F1fgXt3OemR8xCszzyeFL8M7 y6E6xwNLY5K+pF5NMzaLgMag+slV1ineB8Egqto/oaQF3zCymny32EBzxCZwrpHb3xJ0 0bkWuG05PB0kWdOH4o3OX/cX30zsJneljORkRRgkLqZy2mYSOetPJ2m1xNu+NVOEUeBG b95+SQ5WbdWrOhRgEoh9BjHHBxW5Gsm1Imw5i5bN5wYb2SEwbu+UVf6VtsQ9CyEQIZOB g22Q== X-Gm-Message-State: AODbwcCMrTlqtH9sw6/7y7VfmCa6UH1qSUcRwrY0CTL2N7mtKzbGbbCP 5jEiW831/tT4So+wm8A= X-Received: by 10.46.22.18 with SMTP id w18mr7017641ljd.85.1494310649442; Mon, 08 May 2017 23:17:29 -0700 (PDT) Received: from [10.0.200.185] (87-100-228-90.bb.dnainternet.fi. [87.100.228.90]) by smtp.googlemail.com with ESMTPSA id u24sm3097086lfi.36.2017.05.08.23.17.28 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 May 2017 23:17:29 -0700 (PDT) Subject: Re: [ANNOUNCEMENT] New: cygextreg-1.2.0-1 To: cygwin@cygwin.com References: <1351717921.20170505141750@yandex.ru> From: Joni Eskelinen Message-ID: Date: Tue, 09 May 2017 09:57:00 -0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <1351717921.20170505141750@yandex.ru> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2017-05/txt/msg00117.txt.bz2 On 5.5.2017 14.17, Andrey Repin wrote: > Greetings, Joni Eskelinen! > >> The following package has been added to the Cygwin distribution: > >> * cygextreg-1.2.0-1 > > >> Scripts are executed with bash > > This must not be the case, unless explicitly requested. Enough that > all Windows associations are executed with cmd if you try to > CreateProcess blindly. Don't copy this mistake. > Bash is used as an intermediary shell that executes the script. Generally a shebang line denotes the actual interpreter. Bash was chosen because it's bundled with a default Cygwin installation. > If you want to make it useful, write a thin wrapper over exec() that > finds out and runs proper interpreter, and support it with options to > make interpreters happy. F.e. convert $0 to Cygwin path, if > interpreter don't understand native paths (i.e. dash cringe over > non-latin1 native paths and I yet to find out why). > All native paths are converted to Cygwin equivalents before invoking bash, ie. $0 as in the path of the file that was clicked from Windows, and consecutive arguments if some files were dragged and dropped to registered file icon. That is, the script shall always receive only Posix style paths, by design. >> in an interactive login shell. > > This should be optional. Login shell may cause $(pwd) to change, not > to mention, it alters environment. > >> If the executed script exits with a non-zero code, MinTTY window > > This should be optional. > >> shall be kept open > > This should be optional. > Nice suggestions. I've thought to implement per extension options especially for keeping the window open after completion. Script is actually invoked roughly as follows: /bin/bash -il -c 'cd && ./' with proper escaping applied. So even though user's personal init script changes the working directory, the script will be invoked in its containing directory. I think it's a reasonable default to have bash run this way, since there's a fair chance that scripts require environmental variables set in .bashrc or like (eg. $PATH to ruby gems). - Joni -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple