summaryrefslogtreecommitdiff
path: root/core/apps/embeddedkonsole/main.cpp
Unidiff
Diffstat (limited to 'core/apps/embeddedkonsole/main.cpp') (more/less context) (show whitespace changes)
-rw-r--r--core/apps/embeddedkonsole/main.cpp60
1 files changed, 60 insertions, 0 deletions
diff --git a/core/apps/embeddedkonsole/main.cpp b/core/apps/embeddedkonsole/main.cpp
new file mode 100644
index 0000000..e3ba346
--- a/dev/null
+++ b/core/apps/embeddedkonsole/main.cpp
@@ -0,0 +1,60 @@
1/* ---------------------------------------------------------------------- */
2/* */
3/* [main.C] Konsole */
4/* */
5/* ---------------------------------------------------------------------- */
6/* */
7/* Copyright (c) 1997,1998 by Lars Doelle <lars.doelle@on-line.de> */
8/* */
9/* This file is part of Konsole, an X terminal. */
10/* */
11/* The material contained in here more or less directly orginates from */
12/* kvt, which is copyright (c) 1996 by Matthias Ettrich <ettrich@kde.org> */
13/* */
14/* ---------------------------------------------------------------------- */
15 /* */
16/* Ported Konsole to Qt/Embedded */
17 /* */
18/* Copyright (C) 2000 by John Ryland <jryland@trolltech.com> */
19 /* */
20/* -------------------------------------------------------------------------- */
21
22#include "konsole.h"
23
24#include <qpe/qpeapplication.h>
25
26#include <qfile.h>
27
28#include <unistd.h>
29#include <stdio.h>
30#include <stdlib.h>
31
32
33/* --| main |------------------------------------------------------ */
34int main(int argc, char* argv[])
35{
36 setuid(getuid()); setgid(getgid()); // drop privileges
37
38 QPEApplication a( argc, argv );
39
40#ifdef FAKE_CTRL_AND_ALT
41 QPEApplication::grabKeyboard(); // for CTRL and ALT
42#endif
43
44 QStrList tmp;
45 const char* shell = getenv("SHELL");
46 if (shell == NULL || *shell == '\0')
47 shell = "/bin/sh";
48
49 // sh is completely broken on familiar. Let's try to get something better
50 if ( qstrcmp( shell, "/bin/shell" ) == 0 && QFile::exists( "/bin/bash" ) )
51 shell = "/bin/bash";
52
53 putenv((char*)"COLORTERM="); // to trigger mc's color detection
54
55 Konsole m( "test", shell, tmp, TRUE );
56 m.setCaption( Konsole::tr("Terminal") );
57 a.showMainWidget( &m );
58
59 return a.exec();
60}