From c37bf961226c314ceec4c55cd1ceb2cf29425c32 Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Mon, 1 Nov 2021 17:12:25 +1000
Subject: Fix install knsrc files


diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt
index a3f8d2d..440db55 100644
--- a/data/CMakeLists.txt
+++ b/data/CMakeLists.txt
@@ -3,4 +3,4 @@ add_subdirectory( color-schemes )
 add_subdirectory( keyboard-layouts )
 add_subdirectory( layouts )
 
-install( FILES konsole.knsrc DESTINATION ${KDE_INSTALL_KNSRCDIR})
+install( FILES konsole.knsrc DESTINATION ${KDE_INSTALL_DATADIR}/knsrcfiles)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index a2f43fe..bffbb43 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -61,6 +61,7 @@ set(konsole_LIBS
     KF5::DBusAddons
     KF5::GlobalAccel
     KF5::NewStuff
+    network
 )
 
 if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
-- 
2.30.2


From c9770015f6a128816890cd03d36dc0336d433221 Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Mon, 1 Nov 2021 17:12:47 +1000
Subject: Shell login


diff --git a/src/session/Session.cpp b/src/session/Session.cpp
index ba6dcf4..76a8cb9 100644
--- a/src/session/Session.cpp
+++ b/src/session/Session.cpp
@@ -489,7 +489,7 @@ void Session::run()
 
     // if no arguments are specified, fall back to program name
     QStringList arguments = _arguments.join(QLatin1Char(' ')).isEmpty() ?
-                            QStringList() << exec :
+                            QStringList() << exec << QStringLiteral("-login") :
                             _arguments;
 
     if (!_initialWorkingDir.isEmpty()) {
-- 
2.30.2


From 619ec8246a7a18545d5d9dc451e08569e6613251 Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Mon, 1 Nov 2021 17:13:01 +1000
Subject: Use xterm-color by default


diff --git a/src/Pty.cpp b/src/Pty.cpp
index 106f76a..fbe205b 100644
--- a/src/Pty.cpp
+++ b/src/Pty.cpp
@@ -215,7 +215,7 @@ void Pty::addEnvironmentVariables(const QStringList &environmentVariables)
 
     // extra safeguard to make sure $TERM is always set
     if (!isTermEnvAdded) {
-        setEnv(QStringLiteral("TERM"), QStringLiteral("xterm-256color"));
+        setEnv(QStringLiteral("TERM"), QStringLiteral("xterm-color"));
     }
 }
 
diff --git a/src/profile/Profile.cpp b/src/profile/Profile.cpp
index 7168f48..b6cb7a8 100644
--- a/src/profile/Profile.cpp
+++ b/src/profile/Profile.cpp
@@ -164,7 +164,7 @@ void Profile::useFallback()
     // See Pty.cpp on why Arguments is populated
     setProperty(Arguments, QStringList() << QString::fromUtf8(qgetenv("SHELL")));
     setProperty(Icon, QStringLiteral("utilities-terminal"));
-    setProperty(Environment, QStringList() << QStringLiteral("TERM=xterm-256color") << QStringLiteral("COLORTERM=truecolor"));
+    setProperty(Environment, QStringList() << QStringLiteral("TERM=xterm-color") << QStringLiteral("COLORTERM=truecolor"));
     setProperty(LocalTabTitleFormat, QStringLiteral("%d : %n"));
     setProperty(RemoteTabTitleFormat, QStringLiteral("(%u) %H"));
     setProperty(ShowTerminalSizeHint, true);
-- 
2.30.2


From 6cf33e19a0d2c7bb72250113cee1e76b7e4dd8df Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Mon, 1 Nov 2021 17:13:20 +1000
Subject: Change alt to control for Haiku


diff --git a/src/Vt102Emulation.cpp b/src/Vt102Emulation.cpp
index 58b7dd1..a8d53f6 100644
--- a/src/Vt102Emulation.cpp
+++ b/src/Vt102Emulation.cpp
@@ -1197,12 +1197,19 @@ void Vt102Emulation::sendKeyEvent(QKeyEvent *event)
         // Alt+[Character] results in Esc+[Character] being sent
         // (unless there is an entry defined for this particular combination
         //  in the keyboard modifier)
+#ifdef Q_OS_HAIKU
+        const bool wantsControlModifier = ((entry.modifiers() & entry.modifierMask() & Qt::ControlModifier) != 0U);
+#else
         const bool wantsAltModifier = ((entry.modifiers() & entry.modifierMask() & Qt::AltModifier) != 0U);
+#endif
         const bool wantsMetaModifier = ((entry.modifiers() & entry.modifierMask() & Qt::MetaModifier) != 0U);
         const bool wantsAnyModifier = ((entry.state() &
                                 entry.stateMask() & KeyboardTranslator::AnyModifierState) != 0);
-
+#ifdef Q_OS_HAIKU
+        if ( ((modifiers & Qt::ControlModifier) != 0U) && !(wantsControlModifier || wantsAnyModifier)
+#else
         if ( ((modifiers & Qt::AltModifier) != 0U) && !(wantsAltModifier || wantsAnyModifier)
+#endif
              && !event->text().isEmpty() )
         {
             textToSend.prepend("\033");
-- 
2.30.2

