unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Emacs can't capture fzf output in Windows 10
@ 2020-03-02  4:25 Shuguang Sun
  2020-03-02  8:42 ` Eli Zaretskii
  0 siblings, 1 reply; 2+ messages in thread
From: Shuguang Sun @ 2020-03-02  4:25 UTC (permalink / raw)
  To: help-gnu-emacs

Dear all,


I'm trying to use fzf (junegunn/fzf) in windows, however it seems emacs can't capture the output of fzf.


Example:  fzf with -filter will be in filter mode and do not start interactive finder. 

- In shell (cmd): "fzf.exe --filter=tmp" will not exit
- In shell (cmd): "fzf.exe --filter=tmp > aa.txt"  will not exit

- (call-process "cmd.exe" nil t nil "/C" "start" "fzf" "--filter=tmp") will give a flash window (with list of findings) and print 0 in emacs.

- (shell-command "fzf --filter=tmp") will lead to a message (Shell command failed with code 1 and no output)
- (shell-command-to-string "fzf --filter=tmp") give a empty string


However if I run "fzf --filter=tmp" in the CMD box it will provide a list of finding, and "fzf --filter=tmp > aa.txt" will print the findings to file aa.txt.


It can't run fzf in interactive mode as I understand there is no true term for emacs in windows but why it can't be run in filter mode?





It is not put in the bugs report as I don't understand the mechanism whether it is a bug.



- Windows 10
- Emacs 28 (I think is not only for 28)



System information:
In GNU Emacs 28.0.50 (build 2, x86_64-w64-mingw32)  of 2020-02-27
Repository revision: 07da629926daf849aab248175c88cf53a5e21558
Repository branch: master
Windowing system distributor 'Microsoft Corp.', version 10.0.18362
System Description: Microsoft Windows 10 Enterprise (v10.0.1903.18362.657)




Thanks,
Shuguang Sun

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Emacs can't capture fzf output in Windows 10
  2020-03-02  4:25 Emacs can't capture fzf output in Windows 10 Shuguang Sun
@ 2020-03-02  8:42 ` Eli Zaretskii
  0 siblings, 0 replies; 2+ messages in thread
From: Eli Zaretskii @ 2020-03-02  8:42 UTC (permalink / raw)
  To: help-gnu-emacs

> From: "Shuguang Sun" <shuguang79@qq.com>
> Date: Mon, 2 Mar 2020 12:25:48 +0800
> 
> I'm trying to use fzf (junegunn/fzf) in windows, however it seems emacs can't capture the output of fzf.
> 
> 
> Example:&nbsp; fzf with -filter will be in filter mode and do not start interactive finder. 
> 
> - In shell (cmd): "fzf.exe --filter=tmp" will not exit
> - In shell (cmd): "fzf.exe --filter=tmp &gt; aa.txt"&nbsp; will not exit
> 
> - (call-process "cmd.exe" nil t nil "/C" "start" "fzf" "--filter=tmp") will give a flash window (with list of findings) and print 0 in emacs.
> 
> - (shell-command "fzf --filter=tmp") will lead to a message (Shell command failed with code 1 and no output)
> - (shell-command-to-string "fzf --filter=tmp") give a empty string
> 
> 
> However if I run "fzf --filter=tmp" in the CMD box it will provide a list of finding, and "fzf --filter=tmp &gt; aa.txt" will print the findings to file aa.txt.
> 
> 
> It can't run fzf in interactive mode as I understand there is no true term for emacs in windows but why it can't be run in filter mode?

It looks like fzf uses direct screen I/O?  If so, this won't work on
Windows when stdout is a pipe, which is what happens when Emacs on
Windows runs a subprocess.

I suggest to open an issue with fzf, and ask there whether it can run
with pipes as stdin/stdout.



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-03-02  8:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-02  4:25 Emacs can't capture fzf output in Windows 10 Shuguang Sun
2020-03-02  8:42 ` Eli Zaretskii

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).