This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

run-1.3.3-1: Unicode text and empty args


I have been trying to use run (current version 1.3.3-1) to launch
emacsclient-w32 from the desktop via SendTo without having a console-window
pop up. It does work, but I have found two problems that prevent this from
working in certain cases:
1) Unicode text arguments: If I pass arguments to run with non-ANSI text
(German Umlaute in my case), they arrive at the called program (in my case
emacsclient-w32) garbled.
2) Empty args: There ARE cases where we want to do this, e.g. pass the -a ""
option to emacsclient, but this does not work even with the --quote option
to run - the empty arg is silently "swallowed".
 
To illustrate the problem, consider the following command-line, which passes
an empty arg and one containing an Umlaut (hope it shows up properly!):
run --run-verbose --run-debug=1 --quote bash -c 'exec >tmp; echo $#; echo
"$0" "$@"' a b c d "" ä 2>&1 | cat
 
See attachment 1 for what it gives on my system and what I think it should
show - and actually does with some small changes I hacked up. For the sake
of completeness I also attach output of cygcheck -svr.
 
The changes I propose are contained in the attachment 3, which was created
by running "cygport run package" (after modification and compilation, of
course). Apart from fixing the 2 problems above I also updated the man-page,
borrowing from the run2 man-page. I did not touch NEWS, ChangeLog, etc.
though. I hope this change can be adopted by the kind maintainers:-)
 
My testing showed some other issues I do not consider urgent, but are worth
mentioning:
1) run DOES handle symlinks, but only if one passes the program-name with an
absolute path or the symlink has a name with the right suffix (e.g. .exe) -
which unfortunately is not the case with the symlinks provided (e.g. for
emacs and emacsclient) via the alternatives system. This would require
fixing the symlinks in packages using alternatives - or fixing run to
process the program-name in the same way as the spawn/exec family of
functions.
2) run does not execute scripts as of now - on the other hand since the
exec/spawn functions do so, it should in principle be possible to layer run
on an extended form of those functions. That would really simplify creating
desktop-shortcuts by placing all complexity in a shell-script and using the
runprogram mechanism to call it - rather than packing a complex command-line
(typically using bash) into the shortcut.
 
Regards, Martin

Attachment: run-test.txt
Description: Text document

Attachment: cygcheck-svr-150515.out
Description: Binary data

Attachment: run.src.patch
Description: Binary data

--
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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]