[pacman-dev] -Qi output corrupted when using screen

Xavier Chantry chantry.xavier at gmail.com
Fri Feb 26 09:56:37 EST 2010


On Fri, Feb 26, 2010 at 3:38 PM, Roman Kyrylych
<roman.kyrylych at gmail.com> wrote:
> Hi!
>
> It has been a looong time since I last posted here
> (or even read the list), so please forgive me
> if this is a known issue.
>
> I have a VPS on Linode and they have a tool called LISH
> which is a minimal environment that is accessible via
> logging in via ssh on the _host_.
> There is a screen session that shows the output from
> /dev/hvc0 (which is hardware tty in Xen),
> so you can access your system even if you locked
> yourself from accessing it via ssh.
>
> When doing pacman -Qi in that screen session
> I get corrupted output like this:
> <some text from the top of the host's tty buffer goes here first>
>                 Feb
>                 2010
>                 12:14:18
>                 AM
>                 UTC
> Install Date   : Sun
>                 14
>                 Feb
>                 2010
>                 02:21:13
>                 PM
>                 UTC
> Install Reason : Explicitly
>                 installed
> Install Script : Yes
> Description    : Utility
>                 programs
>                 used
>                 for
>                 creating
>                 patch
>                 files
>
> This happens only when doing -Qi.
>
> Any ideas about this?
> And if it's a known issue - how to fix it?
>

from src/pacman/util.c :
/* gets the current screen column width */
int getcols(void)
{
#ifdef TIOCGSIZE
  struct ttysize win;
  if(ioctl(1, TIOCGSIZE, &win) == 0) {
    return win.ts_cols;
  }
#elif defined(TIOCGWINSZ)
  struct winsize win;
  if(ioctl(1, TIOCGWINSZ, &win) == 0) {
    return win.ws_col;
  }
#endif
  return 0;
}

I don't know anything about this stuff, what the limitations of the
above code are, etc...
But it would be useful to know in which case you are in the above
code, and what value is returned by that function.

A quick google for TIOCGSIZE : http://www.ohse.de/uwe/software/resize.c.html
this program demonstrates how complicated a simple task can be:
    the inquiry of the remote terminals window size.

...


More information about the pacman-dev mailing list