Error writing input to command

Neovim version (nvim -v) NVIM v0.6.0-dev+210-g6751d6254 Vim (not Nvim) behaves the same? No. Operating system/version macOS 10.15.7 Terminal name/version iTerm2 $TERM environment variable xterm-256...

Neovim version (nvim -v)

NVIM v0.6.0-dev+210-g6751d6254

Vim (not Nvim) behaves the same?

No.

Operating system/version

macOS 10.15.7

Terminal name/version

iTerm2

$TERM environment variable

xterm-256color

Installation

Github Releases

How to reproduce the issue

The following is my neovim folder:

$ tree 
.
├── init.lua
├── lua
│  └── kd
│     ├── config.lua
│     └── plugins.lua
└── plugin
   └── packer_compiled.lua

The following is the init.lua file:

-- ./init.lua
require("kd/plugins")
require("kd/config")

The following is the plugins.lua file:

-- ./lua/kd/plugins.lua
M = {}

local install_path = vim.fn.stdpath("data") .. "/site/pack/packer/start/packer.nvim"

if vim.fn.empty(fn.glob(install_path)) > 0 then
  vim.fn.system({ "git", "clone", "https://github.com/wbthomason/packer.nvim", install_path })
  vim.api.nvim_command("packadd packer.nvim")
end

local packer = require("packer")
local use = packer.use

packer.reset()

packer.startup({
  function()
    use("wbthomason/packer.nvim")

    use({
      "ibhagwan/fzf-lua",
      requires = {
        "vijaymarupudi/nvim-fzf",
        "kyazdani42/nvim-web-devicons",
      },
    })

  end,
})

return M

The config.lua is located at the link below and is entirely commented:

https://github.com/kdheepak/dotfiles/blob/4ac28a0017f586f2188ac1628f6d4796b7e72a0d/nvim/lua/kd/config.lua

If the file is empty then the issue does not occur. If the file has content that is more than the screen height (???), the issue occurs, even if all the content is commented.

Open neovim with the above configuration and run :PackerCompile.

Opening neovim lua/kd/config.lua and then running :lua require("fzf-lua").files({cwd = "~/gitrepos/dotfiles"}) gives me the following error:

E5677: Error writing input to shell-command: EPIPE
E5677: Error writing input to shell-command: EPIPE

The error appears to originate from internal neovim:

msg_schedule_emsgf(_(«E5677: Error writing input to shell-command: %s«),

Opening neovim without any file arguments and then running :lua require("fzf-lua").files({cwd = "~/gitrepos/dotfiles"}) does not result in any error.

Deleting the contents of lua/kd/config.lua and then opening neovim lua/kd/config.lua and then running :lua require("fzf-lua").files({cwd = "~/gitrepos/dotfiles"}) does not cause the error.

Here’s screencase of this error:

fzf-lua-minimal-error-1080p.mov

When the contents of the config.lua file are all commented, I get the error. When I delete the contents of the config.lua file, I don’t get any error.

After the error occurs, fzf-lua appears to run normally. Every time I run fzf-lua.files I get the same error.

This was originally discussed here: ibhagwan/fzf-lua#89

Expected behavior

Error does not occur.

Actual behavior

Vim internal error

E5677: Error writing input to shell-command: EPIPE
E5677: Error writing input to shell-command: EPIPE

Recommend Projects

  • React photo

    React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo

    Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo

    Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo

    TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo

    Django

    The Web framework for perfectionists with deadlines.

  • Laravel photo

    Laravel

    A PHP framework for web artisans

  • D3 photo

    D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Visualization

    Some thing interesting about visualization, use data art

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo

    Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo

    Microsoft

    Open source projects and samples from Microsoft.

  • Google photo

    Google

    Google ❤️ Open Source for everyone.

  • Alibaba photo

    Alibaba

    Alibaba Open Source for everyone

  • D3 photo

    D3

    Data-Driven Documents codes.

  • Tencent photo

    Tencent

    China tencent open source team.

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Input for read command

Hello,

I want to use the read command in order to input a keyword from the keyboard.
I then want to use this keyword in a grep command.
How to I input a phrase as a keyword? For example if I use
read keyword
«today is»

and then use grep, I get «No such file or directory» error. (6 Replies)

Discussion started by: FelipeAd

2. Shell Programming and Scripting

Script to read command line input and change it to some form

Hi,

I want to write a small code in which script changes command line input to some form.
Example

script.sh a1 a2 a3 a4 …..

output should be «a1|a2|a3|…..»

Number of inputs in command line can be any variable (2 Replies)

Discussion started by: Raza Ali

3. Shell Programming and Scripting

Read input file with in awk script not through command line

Hi All,

Do we know how to read input file within awk script and send output toanother log file. All this needs to be in awk script, not in command line. I am running this awk through crontab.

Cat my.awk
#!/bin/awk -f
function test(var){
some code}
{
}
END
{
print»test code»
} (5 Replies)

Discussion started by: random_thoughts

4. Shell Programming and Scripting

Print output and read input on same line

How do I print output and read input on the same line in ksh?

echo Hello, what is your name? read name (1 Reply)

Discussion started by: robin_simple

5. Shell Programming and Scripting

Read input while executing the command

Hi everyone, i have made a very simple script where it reads the user input and converts the number from celcius to faranheit but instead of running the command and prompting the user for input I want to be able to simply enter a number at the end of the command to run the script.

ex. instead of… (1 Reply)

Discussion started by: subway69

6. Shell Programming and Scripting

filtering input from read command

I need help understanding a script I’m modifying which someone else has written. Basically I’m looping through a buffer that holds records fetched from a database query. I need a way to separate the primary key values from other attributes in the result. Heres the code:

BUFF=buffer_file
>… (5 Replies)

Discussion started by: d3mon_spawn

7. Shell Programming and Scripting

sed to read line by line and input into another file

I have two files.

Fileone contains
text string one
text string two
text string three

Filetwo contains
Name:
Address:
Summary:
Name:
Address:
Summary:
Name:
Address:
Summary:

I would like to use sed to read each line of file one and put it at the end of the summary line of file… (3 Replies)

Discussion started by: dolacap

8. UNIX for Dummies Questions & Answers

How to read a line of text from user input?

Hiii
I wanna a read a line of text from standard input. The user enter data like this way

name phone_no month1_salary month2_salary

that is user enter the name ,phone no and salary of 2 months in a single line by giving spaces. I wanna add the 3rd and 4th fields …ie add both… (4 Replies)

Discussion started by: krishnampkkm

9. Shell Programming and Scripting

How can I send the input of a read line command through a shell script

Hi All,

I wish to automate the unix command ‘su’ through a shell script.

I would like to pass the content of a file as password to ‘su’ command.

My script is as below,

#! /bin/sh

su userA

while read line
do
rpm -ivh $line
done < pwd.txt

where pwd.txt contains the password of… (6 Replies)

Discussion started by: little_wonder

10. Shell Programming and Scripting

read a file as input and pass each line to another script

Hi, I am trying to write a ftp script which will read a file for filenames and ftp those files to another server. Here’s my ftp script, but it’s scanning the current directory for file names.

My question is how can I pass multiple files (these files will have the name of data files that need to… (0 Replies)

Discussion started by: sajjad02

  1. dd Input/output error writing image to sd card

    I’m trying to set up a second RaspberryPi, so have done this a couple of times before at least with no hassle. But now I’m getting repeated errors trying to write the .img file to a micro sd card. I’ve tried two different cards, one only used once, the other brand new (but bought several months ago), both samsung, one 8Gb the other 16. I had problems initially with the external usb card reader I was using, so swapped that for a usb ‘cradle’ that came with one of the micro cards (they slot into the end of it). I’ve been able to access the cards using this and have tried both ImageWriter and, when that crashed (non-functioning progress bar doesn’t inspire confidence) tried Etcher. Same problem: writes a bit, then finishes prematurely. So I went a bit out of my comfort zone and tried dd on the command line. I’ve tried that four or five times now and it makes more progress than the other methods, but still ends before completion with an error message. Here’s the output from my last attempt:

    Code:

    nick@nick-build-1:~$ sudo dd if=/home/nick/RaspberryPi/Volumio1.55PI.img bs=4M | pv -s 2G | sudo dd of=/dev/sdh 
    [sudo] password for nick: [sudo] password for nick:    0B 0:00:01 [   0B/s] [>     0B 0:00:07 [   0B/s] [> 
    
    dd: writing to `/dev/sdh': Input/output error                  ]  6% ETA 9:51:38 
    262625+0 records in 
    262624+0 records out 
    134463488 bytes (134 MB) copied, 2790.32 s, 48.2 kB/s 
     128MB 0:46:37 [  47kB/s] [=>                                 ]  6%

    I’ve reformatted the cards (FAT32) before each new attempt and checking them after the failed write process there are always folders and files on the card, such as «overlays» «System Volume Information» bootcode.bin install-kernel.sh kernel.img start.elf etc etc. Investigating with GParted after my most recent attempt, it shows a FAT32 partition of 75Mb (24 used) at /dev/sdh1, an «unknown» (with orange exclamation triangle) partition of 5.85GB at /dev/sdh3 and 5.85GB unallocated.

    Writing an image file to an sd card should be a piece of cake, even on old equipment like mine (self-built 3ghz P4 running Ubuntu 12.04). The fact that the same problem appears to occur every time suggests to me that there’s something obvious I’ve got wrong. Can someone kindly help me find it?

    Last edited by nickdc; June 15th, 2016 at 07:13 PM.

    Reason: change tag


  2. Re: dd Input/output error writing image to sd card

    I don’t think you should invoke dd twice.

    I think the easiest way to get things right is to use mkusb as a ‘safety belt’ and ‘wizard’ to get the dd command line right. See this link

    https://help.ubuntu.com/community/mkusb

    Good luck


  3. Re: dd Input/output error writing image to sd card

    Thanks for the advice, I’ll take a look at mkusb, though if it’s a hood for dd I anticipate getting the same errors. I used the second dd command after reading help pages for pv. I only turned to pv after several failures with dd on its own (and just using the command at the beginning of the string) and wanting more info on its progress.


  4. Re: dd Input/output error writing image to sd card

    In that case maybe the SD card cannot be written to (for some other reason).

    In many such cards there is a small mechanical switch, which you can use to make it read-only alias ‘lock’ or read/write. Check if you happened to touch it and set it in the read-only position.

    There might also be other problems with the card. Check if you can get write access to it from another computer or via another adapter or slot. For example, you can try to format it (which is a write operation). See also these links:

    Pendrive lifetime

    Repair the partition table and file system of a pendrive


  5. Re: dd Input/output error writing image to sd card

    Thanks. Yes, have checked they’re not locked — as I said, this is happening on two different cards, both of which are formatting ok each time after a failed burn. Both cards can be put into my tablet where they perform as expected. I’m now wondering if it’s a hardware problem with my desktop pc as I’ve been getting sudden mouse freezes and having to do a power shutdown. I replaced the power supply a few months ago because it became very unstable and the new psu seemed to fix things, but now I’m wondering if it was a mbo or other hardware issue which is now recurring. The image writing is probably the longest running single process I use the machine for.


  6. Re: dd Input/output error writing image to sd card

    If you can borrow another computer, maybe you can run a live DVD or USB drive and run the dd command line there, I think safer if you install mkusb (temporarily) and use it to flash from the image (img) file to the card.

    It is also possible to use Win32 Disk Imager, if you can borrow a computer with Windows.

    Win32DiskImager makes an Ubuntu family USB boot drive in Windows

    It works with img files as well as with iso files.


  7. Re: dd Input/output error writing image to sd card

    Hooray! I’ve had success with mkusb — many thanks, sudodus, for suggesting I try that. Worked first time, and on my old machine — didn’t have to beg or borrow another pc. I certainly endorse your recommendation of mkusb, an excellent utility.


  8. Re: dd Input/output error writing image to sd card

    I’m glad you found a solution (and thanks for marking the thread as solved to help other people)


  9. Re: dd Input/output error writing image to sd card

    Oh dear! Problem not entirely solved, and I’m not sure if I should continue here or start a new thread under mkusb….?
    Having successfully written one of the images, it still wouldn’t boot my Pi. OK, so that’s not entirely unexpected as others having similar problems, almost certainly related to the image file itself. So I take another micro sd card, 16gb this one, and use mkusb to write a different image of around 4gb, that others have had success with. Mkusb seemed to be doing fine, kept going much longer than all the earlier attempts with dd etc, but ended in a fail:»No space left on device». Exactly the same on a second try. I realise this would not be a failure message had I been attempting to completely wipe the whole drive, but this is an install, and I got a success message with the other image on the other card. Clearly there’s plenty of space on the drive, so I’m puzzled why the process is failing.


  10. Re: dd Input/output error writing image to sd card

    I think we can continue here (in this thread).

    No space left on device indicates just that: I would assume that the target is too small for the image. Is this also an img file, or is it a compressed image file, for example filename.img.gz or filename.img.xz?

    If it is a ‘plain’ img file, the target drive must be of exactly the same size or larger. Flash cards and pendrives are not exactly the nominal size, some are slightly larger, some are slightly smaller. If you compare the size it must be measured in the same units, for example {Megabytes (base 10) or Mibibytes (base 2)} or {Gigabytes (base 10) or Gibibytes (base 2)}.

    Example: 8 GB ~ 7.45 GiB

    Code:

    $ bc
    bc 1.06.95
    Copyright 1991-1994, 1997, 1998, 2000, 2004, 2006 Free Software Foundation, Inc.
    This is free software with ABSOLUTELY NO WARRANTY.
    For details type `warranty'. 
    4000000000/1024/1024/1024
    3
    scale=9
    4000000000/1024/1024/1024
    3.725290298
    8000000000/1024/1024/1024
    7.450580596
    16000000000/1024/1024/1024
    14.901161193

    Please post an output showing the kind of and size of the image files and of the target drives (the SD cards).

    If uncompressed,

    Code:

    ls -l filename.img  # size in bytes
    
    ls -lh filename.img  # size in human readable units / MiB or GiB

    should do.

    If compressed with xz, try

    Code:

    xz --robot --list filename.img.xz

    to get the result in bytes,

    or

    Code:

    xz -l filename.img.xz

    to get the result in MiB.

    If compressed with gzip (a gz file), the listing of the compressed size might be borked due to overflow in the representation of numbers.

    The size of the SD cards can be listed with

    Code:

    sudo parted -ls  # size in MB or GB
    sudo lsblk -fm  # size in MiB or GiB

    Last edited by sudodus; June 20th, 2016 at 10:38 AM.


I wrote a Server-Client model program in java, and it works great on eclipse. However, when I try to run the client via command line (in Windows 10), I can see the input that I type on my keyboard for stdin only after I press enter. Why is that, and how can I solve this?
Here is the client code (not the best one, I know):

public class MyEchoClient {
    public static void main(String[] args) throws IOException{
        Socket clientSocket = null; 
        PrintWriter out = null;
        BufferedReader in = null;
        String host = args[0], msg, tmp;
        int port = Integer.decode(args[1]).intValue(), len;
        System.out.println("Connecting to " + host + ":" + port);

        try {  
            clientSocket = new Socket(host, port); 
            out = new PrintWriter(new OutputStreamWriter(clientSocket.getOutputStream(), "UTF-8"), true);
        } catch (UnknownHostException e) {
              System.out.println("Unknown host: " + host);
              System.exit(1);
        } catch (IOException e) {
            System.out.println("Couldn't get output to " + host + " connection");
            System.exit(1);
        }

        try { 
            in = new BufferedReader(new InputStreamReader(clientSocket.getInputStream(),"UTF-8"));
        } catch (IOException e) {
            System.out.println("Couldn't get input to " + host + " connection");
            System.exit(1);
        }

        System.out.println("Connected to server!");

        BufferedReader userIn = new BufferedReader(new InputStreamReader(System.in));
        try{
            while(true){
                while(!userIn.ready()){
                    if (in.ready()){ 
                        tmp=in.readLine();
                        len=tmp.length();
                        System.out.print(tmp);
                        if ((len>0 && tmp.charAt(tmp.length()-1)=='>') ||  tmp.contains("UNIDENTIFIED"))
                            System.out.println();
                    }
                }
                System.out.println();
                msg = userIn.readLine();
                if (msg==null) { break; }
                out.println(msg);
                tmp=in.readLine();
                if (tmp.contains("~")) { break; }
                System.out.println(tmp);
            }
        }
        catch(IOException e){ System.out.println("Error with server connection."); }
        System.out.println("Exiting...");
        out.close();
        in.close();
        userIn.close();
        clientSocket.close();
    }
}

What I have tried:

I tried to find a replacement for the ready() function, because I think that what causes the troubles. But I didn’t find equivalent function that works…


This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject,
20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8
+1 (416) 849-8900

Понравилась статья? Поделить с друзьями:

Читайте также:

  • Error writing fat
  • Error using mldivide matrix dimensions must agree
  • Error недостаточно памяти саи
  • Error writing etc fstab read only file system
  • Error using matlab internal math interp1 sample points must be unique

  • 0 0 голоса
    Рейтинг статьи
    Подписаться
    Уведомить о
    guest

    0 комментариев
    Старые
    Новые Популярные
    Межтекстовые Отзывы
    Посмотреть все комментарии