delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2016/07/16/22:13:39

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:date:message-id:from:to:subject:mime-version
:content-type; q=dns; s=default; b=l7GtFjtwe20UYhYloIv1l39ok5kQz
iqHLX1DifjFLy+xNWq7NM4n0l/8vLR+aBNjSrAyzQkHp7e+P5CZB0O7fsU+ilpfd
SqA9/o6enfStgSBTUk9lkd3qPba1qniEtFtZFCceracZdxsWImclgalxyJHuRBah
835xTggZRia1C8=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:date:message-id:from:to:subject:mime-version
:content-type; s=default; bh=etHoqhMxuhi7X0/DQRXbJmd6De0=; b=fRI
o5nXDXp2hi8FtiTXNBYjbv0eIGcPtjdbKHAXlKOaRXOazJ5MWXFa6Hr3feso/FE5
w+T0q36Ne3yBg8bQAitIgFipuEvuKWdg3LrR8K+2S0DTXoKIi0sqqsApyrT1HbBj
nLMcJAYrOn/cmRL9pKMN/iKDLcy5QocJi+IpcQdg=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-1.3 required=5.0 tests=BAYES_40,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:454, menu, logon, HX-Greylist:succeeded
X-HELO: mail.j10n.org
Date: Sun, 17 Jul 2016 11:14:06 +0900
Message-ID: <vriuvb05105t.wl%shinra@j10n.org>
From: AIDA Shinra <shinra AT j10n DOT org>
To: cygwin AT cygwin DOT com
Subject: [PATCH] Better UNC path support in chere
User-Agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL/10.8 MULE XEmacs/21.4 (patch 22) (Instant Classic) (x86_64-unknown-cygwin)
MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka")

--Multipart_Sun_Jul_17_11:14:06_2016-1
Content-Type: text/plain; charset=US-ASCII

I modified "chere" for following improvements:

* UNC path support in "chere -1" mode

* Partial tcsh support in "chere -1" mode

* Simplified quoting

* Support for Windows log-on name composed of only digits

And also a feature request:

* Could anyone add an option to move "Cygwin Prompt Here"
  command into a shift-click menu? The following patch
  contains a hard-coded (not switchable) one.


Regards,
shinra


--Multipart_Sun_Jul_17_11:14:06_2016-1
Content-Type: application/octet-stream; type=patch
Content-Disposition: attachment; filename="chere-quoting.diff"
Content-Transfer-Encoding: 7bit

--- /usr/bin/chere	2014-02-21 08:00:09.000000000 +0900
+++ chere	2016-07-17 10:55:31.839227500 +0900
@@ -202,7 +202,7 @@
 {
  # Check windows version and cygwin install directory
  VER=`uname -s`
- ID_USER=`id -nu`
+ ID_USER=`id -u`
  RUN_EXE=""
  ASH_EXE=`cygpath -w /bin/sh`
  BASH_EXE=`cygpath -w /bin/bash`
@@ -477,7 +477,7 @@
 	CPH_DESC="Command Prompt Here (cygwin)";;
   passwd )
 	# Experimental
-	SHELL_EXE="/bin/sh"
+	SHELL_EXE="/bin/bash"
 	# Quoting nightmare. Step through it all
 	# c:\cygwin\bin\sh -c "scmd=`getent passwd \`id -un\` | sed -n \"s?.*:\\\(.*\\\)?\\\1?gp\"`; $scmd -l -c \"cd \\\"c:/program files\\\"; exec $scmd\""
 	# works from the command line
@@ -488,8 +488,9 @@
 	# When evaluated into a variable, need another level of quoting:
 	# "c:\cygwin\bin\sh -c \\\"scmd=\\\`getent passwd \\\\\\\`id -un\\\\\\\` | sed -n \\\\\\\"s?.*:\\\\\\\\\\\\(.*\\\\\\\\\\\\)?\\\\\\\\\\\\1?gp\\\\\\\"\\\`; \\\$scmd -l -c \\\\\\\"cd \\\\\\\\\\\\\\\"%L\\\\\\\\\\\\\\\"; exec \\\$scmd\\\\\\\"\\\""
 	# Ouch. If you think it can be quoted better, let me know.
-	SHELL_CMD="-c \\\"scmd=\\\`getent passwd \\\\\\\`id -un\\\\\\\` | sed -n \\\\\\\"s?.*:\\\\\\\\\\\\(.*\\\\\\\\\\\\)?\\\\\\\\\\\\1?gp\\\\\\\"\\\`; \\\$scmd -l -c \\\\\\\"cd \\\\\\\\\\\\\\\"%L\\\\\\\\\\\\\\\"; exec \\\$scmd\\\\\\\"\\\""
-	ACCEL="Shell Prompt &Here"
+	SHELL_CMD='-c \"scmd=\`/bin/getent passwd \\\`/bin/id -u\\\` | /bin/sed -n '\''s?.*:\\\(.*\\\)?\\\1?gp'\''\`; case \$scmd in *csh*) ;; *) dmy=-\$scmd;; esac; exec -l \$scmd -c '\''cd \\\"\$1\\\"; exec \$2'\'' \$dmy \\\"\$0\\\" \$scmd\" \"%L\"'
+
+	ACCEL="&Cygwin Prompt Here"
 	CPH_DESC="Cygwin Prompt Here"
 
 	# Extra check before installing passwd
@@ -760,6 +761,7 @@
   $REGTOOL -s set $1/ \"$3\"
   $REGTOOL add $1/command
   $REGTOOL -e set $1/command/ \"$4\"
+  # $REGTOOL -s set $1/Extended \"\"
  else
   echo $0 Warning: Not overriding existing entry
   echo


--Multipart_Sun_Jul_17_11:14:06_2016-1
Content-Type: text/plain; charset=us-ascii

--
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
--Multipart_Sun_Jul_17_11:14:06_2016-1--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019