Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Job: Output lost if program being run was installed via 'snap'.

オープン
#672 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
28/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
lua, neovim

調査の方向性

Start at the plenary.job entry points shown in the reproduction: new(), start(), and result(). Reproduce on Linux with jq installed via apt and yq via snap, then inspect how process output is captured for commands whose standard descriptors are sockets. Done means output from snap-installed programs is returned like output from the apt-installed command.

索引モデルが issue の本文から書いたものです。

説明

This was a weird one to try and debug, reproduction requires a Linux system with snap installed, which likely means some Debian derived distribution.

To most easily reproduce, install jq via apt, and yq via snap, save the following as something like /tmp/snap_output_lost.lua, and in neovim run something like :=luafile /tmp/snap_output_lost.lua:

local ok, j = pcall(function()
  return require("plenary.job"):new({
    command = "jq",
    args = { "--version" },
    on_exit = vim.schedule_wrap(function(j, code)
      vim.notify("jq j.result: " .. vim.inspect(j:result()))
    end),
  })
end)
vim.notify("jq ok: " .. vim.inspect(ok))
local spawn_ok, err = pcall(j.start, j)
vim.notify("jq spawn_ok: " .. vim.inspect(spawn_ok) .. ", err: " .. vim.inspect(err))

local ok, j = pcall(function()
  return require("plenary.job"):new({
    command = "yq",
    args = { "--version" },
    on_exit = vim.schedule_wrap(function(j, code)
      vim.notify("yq j.result: " .. vim.inspect(j:result()))
    end),
  })
end)
vim.notify("yq ok: " .. vim.inspect(ok))
local spawn_ok, err = pcall(j.start, j)
vim.notify("yq spawn_ok: " .. vim.inspect(spawn_ok) .. ", err: " .. vim.inspect(err))

On my system, the output from jq is printed, and the output from yq is lost.

Which leads to the next question: Why?

(This took a bit to figure out.)

If you run some long running program installed via snap, launch it with the above, and look at /proc/<pid>/fd/[012], you'll find that they are all sockets.

I'm not yet sure why that matters, but a script that redirects everything to force stdout and stderr to be pipes instead of sockets seems to work for me:

#!/bin/bash

yq "$@" > >(cat) 2> >(cat >&2)
主要言語
Lua
スター
3.5k
フォーク
341
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

nvim-lua/plenary.nvim のほかの issue

nvim-lua/plenary.nvim の issue をすべて見る

似ている issue

Lua の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。