all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: tor.a.s.kringeland@ntnu.no, 51832@debbugs.gnu.org
Subject: bug#51832: Piping unicode text in `shell-command'
Date: Sun, 14 Nov 2021 10:13:47 +0200	[thread overview]
Message-ID: <83mtm7upc4.fsf@gnu.org> (raw)
In-Reply-To: <87y25r8968.fsf@gnus.org> (message from Lars Ingebrigtsen on Sun,  14 Nov 2021 08:53:51 +0100)

> From: Lars Ingebrigtsen <larsi@gnus.org>
> Cc: Tor Kringeland <tor.a.s.kringeland@ntnu.no>,  51832@debbugs.gnu.org
> Date: Sun, 14 Nov 2021 08:53:51 +0100
> 
> >>   (shell-command "echo -n '悟' | pbcopy")
> >> 
> >> or
> >> 
> >>   (shell-command "echo -n 'øøøø' | pbcopy")
> >> 
> >> fills the clipboard with `ÊÇü' and `√∏', respectively, while if I run
> >> the same commands in a terminal emulator outside Emacs I get back the
> >> original input.  The same happens if I run the same shell commands in
> >> `eshell'.  This happens when I run a recent build of Emacs 29 with `-Q'
> >> on macOS Catalina.
> >
> > Please be specific about the "recent build" part: which commit are you
> > using?
> 
> I'm seeing the same issue with the current tree on Macos.
> 
> > There were some problems with the clipboard that were recently fixed.
> 
> This doesn't involve Emacs' interactions with the clipboard, though --
> the pbcopy command is what's putting things on the clipboard.  But
> pbcopy's apparently misinterpreting the bytes it's getting over the pipe
> somehow, which is surprising, because I assumed shell-command just sent
> the entire string to a shell for execution.  (But I haven't read the
> code.)

It could be useful to replace the pipe with redirection to a file, and
see what you get when invoking the command from Emacs and from a shell
prompt outside Emacs.





  reply	other threads:[~2021-11-14  8:13 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-14  3:10 bug#51832: Piping unicode text in `shell-command' Tor Kringeland
2021-11-14  7:26 ` Eli Zaretskii
2021-11-14  7:53   ` Lars Ingebrigtsen
2021-11-14  8:13     ` Eli Zaretskii [this message]
2021-11-14  8:18       ` Lars Ingebrigtsen
2021-11-14  8:25         ` Eli Zaretskii
2021-11-14  9:19           ` Lars Ingebrigtsen
2021-11-14  9:32           ` Lars Ingebrigtsen
2021-11-14  9:46             ` Lars Ingebrigtsen
2021-11-14 10:31               ` Eli Zaretskii
2021-11-14 10:41                 ` Philipp
2021-11-14 10:56                   ` Eli Zaretskii
2021-11-14 11:20                     ` Lars Ingebrigtsen
2021-11-14 11:48                       ` Philipp
2021-11-14 12:16                       ` Eli Zaretskii
2021-11-14 12:31                     ` Alan Third
2021-11-14 13:41                       ` Lars Ingebrigtsen
2021-11-14 14:23                         ` Philipp
2021-11-14 14:28                           ` Lars Ingebrigtsen
2021-11-14 15:20                             ` Alan Third
2021-11-14 15:29                               ` Lars Ingebrigtsen
2021-11-16 20:52                                 ` Alan Third
2022-09-20 13:24                                   ` Lars Ingebrigtsen
2021-11-14 15:01                           ` Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83mtm7upc4.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=51832@debbugs.gnu.org \
    --cc=larsi@gnus.org \
    --cc=tor.a.s.kringeland@ntnu.no \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.