WSL icon indicating copy to clipboard operation
WSL copied to clipboard

problem piping the output of a command to an editor from bash

Open mo18 opened this issue 9 years ago • 3 comments

Windows Version: 15063.483

from bash - ubuntu 16.04 - if I try to pipe output of a command to a windows text editor, it just opens the editor without the output of the command. Ex:

$ svn diff -r 2255:2246 file | subl -

it just opens my sublime editor with a new file called -.

If i run the same command using a linux text editor, it works fine. Ex:

$ svn diff -r 2255:2246 file | vi -

this opens vi with the diff in the editor.

mo18 avatar Jul 27 '17 19:07 mo18

In order for this to work subl will need to support the '-' argument the same way vi does. In your above steps subl an alias to sublime_text.exe?

benhillis avatar Jul 27 '17 19:07 benhillis

that is correct. It didn't occur to me that this could be an issue with the editor. I appreciate the quick response

mo18 avatar Jul 27 '17 19:07 mo18

Seems like piping to stdin is a macOS only feature:

Reading from standard input only works in OS X.

See: http://docs.sublimetext.info/en/latest/command_line/command_line.html#invocations

geneccx avatar Jul 29 '17 12:07 geneccx