mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-30 14:24:35 +08:00
Remove old unneeded code that makes fish_pager wait to become owner of the terminal
darcs-hash:20060203093314-ac50b-537c521093e85a110f822cde37b022d7706e8cb0.gz
This commit is contained in:
parent
07c89c71d8
commit
264c065006
39
fish_pager.c
39
fish_pager.c
|
@ -564,7 +564,7 @@ static int completion_try_print( int cols,
|
||||||
memset( pref_width, 0, sizeof(pref_width) );
|
memset( pref_width, 0, sizeof(pref_width) );
|
||||||
memset( min_width, 0, sizeof(min_width) );
|
memset( min_width, 0, sizeof(min_width) );
|
||||||
|
|
||||||
/* Calculated how wide the list would be */
|
/* Calculate how wide the list would be */
|
||||||
for( j = 0; j < cols; j++ )
|
for( j = 0; j < cols; j++ )
|
||||||
{
|
{
|
||||||
for( i = 0; i<rows; i++ )
|
for( i = 0; i<rows; i++ )
|
||||||
|
@ -814,7 +814,7 @@ static void mangle_descriptions( array_list_t *l )
|
||||||
{
|
{
|
||||||
wchar_t *next = (wchar_t *)al_get(l, i);
|
wchar_t *next = (wchar_t *)al_get(l, i);
|
||||||
wchar_t *in, *out;
|
wchar_t *in, *out;
|
||||||
skip=0;
|
skip=1;
|
||||||
|
|
||||||
while( *next != COMPLETE_SEP && *next )
|
while( *next != COMPLETE_SEP && *next )
|
||||||
next++;
|
next++;
|
||||||
|
@ -866,6 +866,10 @@ static void init()
|
||||||
program_name = L"fish_pager";
|
program_name = L"fish_pager";
|
||||||
wsetlocale( LC_ALL, L"" );
|
wsetlocale( LC_ALL, L"" );
|
||||||
|
|
||||||
|
/*
|
||||||
|
Make fd 1 output to screen, and use some other fd for writing
|
||||||
|
the resulting output back to the caller
|
||||||
|
*/
|
||||||
int out = dup( 1 );
|
int out = dup( 1 );
|
||||||
close(1);
|
close(1);
|
||||||
if( open( ttyname(0), O_WRONLY ) != 1 )
|
if( open( ttyname(0), O_WRONLY ) != 1 )
|
||||||
|
@ -877,6 +881,10 @@ static void init()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
out_file = fdopen( out, "w" );
|
out_file = fdopen( out, "w" );
|
||||||
|
|
||||||
|
/**
|
||||||
|
Init the stringbuffer used to keep any output in
|
||||||
|
*/
|
||||||
sb_init( &out_buff );
|
sb_init( &out_buff );
|
||||||
|
|
||||||
output_init();
|
output_init();
|
||||||
|
@ -894,33 +902,6 @@ static void init()
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Loop until we are in the foreground. */
|
|
||||||
while (tcgetpgrp( 0 ) != getpid())
|
|
||||||
{
|
|
||||||
kill (- getpid(), SIGTTIN);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Put ourselves in our own process group. */
|
|
||||||
if( getpgrp() != getpid() )
|
|
||||||
{
|
|
||||||
if (setpgid (getpid(), getpid()) < 0)
|
|
||||||
{
|
|
||||||
debug( 1,
|
|
||||||
L"Couldn't put the shell in its own process group");
|
|
||||||
wperror( L"setpgid" );
|
|
||||||
exit (1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Grab control of the terminal. */
|
|
||||||
if( tcsetpgrp (STDIN_FILENO, getpid()) )
|
|
||||||
{
|
|
||||||
debug( 1,
|
|
||||||
L"Couldn't grab control of terminal" );
|
|
||||||
wperror( L"tcsetpgrp" );
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
handle_winch( 0 ); /* Set handler for window change events */
|
handle_winch( 0 ); /* Set handler for window change events */
|
||||||
|
|
||||||
tcgetattr(0,&pager_modes); /* get the current terminal modes */
|
tcgetattr(0,&pager_modes); /* get the current terminal modes */
|
||||||
|
|
Loading…
Reference in New Issue
Block a user