Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 99527 - Interactive command with no input as stdout is redirected in pkg_config.
Summary: Interactive command with no input as stdout is redirected in pkg_config.
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Ebuild Support (show other bugs)
Hardware: All All
: High normal (vote)
Assignee: Portage team
Depends on:
Reported: 2005-07-19 07:14 UTC by Kristian Benoit
Modified: 2005-08-08 18:24 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---

Disables logging during pkg_config (99527_skip_config_logging.patch,838 bytes, patch)
2005-07-19 07:24 UTC, Jason Stubbs (RETIRED)
Details | Diff
Fix for this bug. (portage-,679 bytes, patch)
2005-07-19 07:31 UTC, Kristian Benoit
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kristian Benoit 2005-07-19 07:14:18 UTC
When running interactives applications that uses the terminal (curses) in
pkg_config, the program gets a dumb terminal as the output redirected to tee.

Reproducible: Always
Steps to Reproduce:
In pkg_config:
1. cd /usr/src/linux
2. make menuconfig

Actual Results:  
You wont be able to give input to menuconfig plus the terminal is of default
size (80x25) even if running in a bigger term.

Expected Results:  
Be able to use programs that uses curses for configuration.
Comment 1 Jason Stubbs (RETIRED) gentoo-dev 2005-07-19 07:24:04 UTC
Created attachment 63780 [details, diff]
Disables logging during pkg_config
Comment 2 Kristian Benoit 2005-07-19 07:31:10 UTC
Created attachment 63781 [details, diff]
Fix for this bug.

There's a little side effect to the fix, it remove the logging from pkg_config.
But sometimes it does not make sens to log anyway, as in any curses/X based
Comment 3 Jason Stubbs (RETIRED) gentoo-dev 2005-08-08 04:58:29 UTC
Does /dev/tty magic work on *BSD and Darwin in the same fashion that it does 
on Linux? It was suggested that packages that wish to use ncurses or such 
should run `exec < /dev/tty > /dev/tty` or something to that effect. Will this 
work as expected? 
Comment 4 Fabian Groffen gentoo-dev 2005-08-08 08:48:59 UTC
to me, it seems like /dev/tty works the same on ppc-macos as on linux.

if I cat /dev/tty and type something and press return, it is nicely written
twice, so I think it does what you want.
Comment 5 Jason Stubbs (RETIRED) gentoo-dev 2005-08-08 17:51:07 UTC
{ echo foo >/dev/tty ; } </dev/null &>/dev/null 
( ( sleep 2 ; echo foo >/dev/tty ) & disown ) </dev/null &>/dev/null 
were the two test cases I were given. 
Comment 6 Stephen Bennett (RETIRED) gentoo-dev 2005-08-08 17:56:37 UTC
Both those testcases work the same way on FreeBSD as on Linux. If OSX behaves
the same way it looks like a reasonable enough workaround.
Comment 7 Jason Stubbs (RETIRED) gentoo-dev 2005-08-08 18:24:36 UTC
Kito has confirmed that it works on Darwin as well. That means that there's a 
workaround on *NIX systems for the few pkg_config's that won't work with tee 
while the rest can still be logged.