You are not logged in.

#1 2020-05-22 15:43:30

LeSnake
Member
Registered: 2020-04-23
Posts: 2

User input in Pacman hooks?

It is possible to get user input in pacman hooks?

I already tried some ways:
read
sh -c read
python -c print(input())

But every time, it just jump over the input..

Anyone know why this happened and how to fix?

Offline

#2 2020-05-22 15:47:55

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 9,974
Website

Re: User input in Pacman hooks?

I don't think they are meant to be interactive.  Maybe someone from the pacman team will see your message and confirm.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#3 2020-05-22 16:12:19

eschwartz
Trusted User/Bug Wrangler
Registered: 2014-08-08
Posts: 3,321

Re: User input in Pacman hooks?

graysky wrote:

Maybe someone from the pacman team will see your message and confirm.

Stdout and stderr are connected via pipes from the chroot process and don't have direct access to the running terminal.

We explicitly close stdin, (after connecting it, to guarantee that fd 0 exists and it is empty), in order to forbid user input.

This is determinedly intended to not work; don't do it.

References:
https://git.archlinux.org/pacman.git/co … 68f0f8d8a0
https://git.archlinux.org/pacman.git/co … 1087955a7b


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

Board footer

Powered by FluxBB