summaryrefslogtreecommitdiff
path: root/apt-pkg
diff options
context:
space:
mode:
Diffstat (limited to 'apt-pkg')
-rw-r--r--apt-pkg/deb/dpkgpm.cc2
-rw-r--r--apt-pkg/install-progress.cc9
-rw-r--r--apt-pkg/install-progress.h4
3 files changed, 11 insertions, 4 deletions
diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc
index b4bfd1400..b9f839e82 100644
--- a/apt-pkg/deb/dpkgpm.cc
+++ b/apt-pkg/deb/dpkgpm.cc
@@ -1182,7 +1182,7 @@ bool pkgDPkgPM::GoNoABIBreak(APT::Progress::PackageManager *progress)
StartPtyMagic();
// Tell the progress that its starting and fork dpkg
- d->progress->Start();
+ d->progress->Start(d->master);
// this loop is runs once per dpkg operation
vector<Item>::const_iterator I = List.begin();
diff --git a/apt-pkg/install-progress.cc b/apt-pkg/install-progress.cc
index b82b7efde..2215fb1f5 100644
--- a/apt-pkg/install-progress.cc
+++ b/apt-pkg/install-progress.cc
@@ -273,11 +273,18 @@ void PackageManagerFancy::HandleSIGWINCH(int)
SetupTerminalScrollArea(nr_terminal_rows);
}
-void PackageManagerFancy::Start()
+void PackageManagerFancy::Start(int child_pty)
{
int nr_terminal_rows = GetNumberTerminalRows();
if (nr_terminal_rows > 0)
+ {
SetupTerminalScrollArea(nr_terminal_rows);
+ // *cough*
+ struct winsize win;
+ ioctl(child_pty, TIOCGWINSZ, (char *)&win);
+ win.ws_row = nr_terminal_rows - 1;
+ ioctl(child_pty, TIOCSWINSZ, (char *)&win);
+ }
}
void PackageManagerFancy::Stop()
diff --git a/apt-pkg/install-progress.h b/apt-pkg/install-progress.h
index 4b7590983..010be82fd 100644
--- a/apt-pkg/install-progress.h
+++ b/apt-pkg/install-progress.h
@@ -28,7 +28,7 @@ namespace Progress {
virtual ~PackageManager() {};
/* Global Start/Stop */
- virtual void Start() {};
+ virtual void Start(int child_pty=-1) {};
virtual void Stop() {};
/* When dpkg is invoked (may happen multiple times for each
@@ -125,7 +125,7 @@ namespace Progress {
public:
PackageManagerFancy();
~PackageManagerFancy();
- virtual void Start();
+ virtual void Start(int child_pty=-1);
virtual void Stop();
virtual bool StatusChanged(std::string PackageName,
unsigned int StepsDone,