Skip to content

Commit

Permalink
Run shell on the Flatpak host
Browse files Browse the repository at this point in the history
When Terminal is running on Flatpak we need to access the host
system, otherwise the app is pretty useless.

Closes: #36
  • Loading branch information
plfiorini committed Apr 5, 2019
1 parent 891be87 commit 0ae05a8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/lib/Session.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include <QDir>
#include <QFile>
#include <QRegExp>
#include <QStandardPaths>
#include <QStringList>
#include <QFile>
#include <QtDebug>
Expand Down Expand Up @@ -324,6 +325,12 @@ void Session::run()
_shellProcess->setFlowControlEnabled(_flowControl);
_shellProcess->setErase(_emulation->eraseChar());

// If we are running on Flatpak, we should have access to the host
if (!QStandardPaths::locate(QStandardPaths::RuntimeLocation, QLatin1String("flatpak-info")).isEmpty()) {
arguments.prepend(exec);
exec = QLatin1String("/usr/bin/flatpak-spawn");
}

// this is not strictly accurate use of the COLORFGBG variable. This does not
// tell the terminal exactly which colors are being used, but instead approximates
// the color scheme as "black on white" or "white on black" depending on whether
Expand Down

0 comments on commit 0ae05a8

Please sign in to comment.