parent
27d30eb361
commit
c0cce28724
14 changed files with 116 additions and 877 deletions
@ -0,0 +1,15 @@ |
||||
[README] |
||||
|
||||
Beside a few png pictures you find |
||||
|
||||
- *.schema : README.Schema |
||||
- *.keytab : README.KeyTab |
||||
- *.desktop : README.Desktop |
||||
|
||||
files here. |
||||
|
||||
Please consult the indicated READMEs |
||||
to learn about their syntax and purpose. |
||||
|
||||
kcmkonsole.C, brightness.png, colorness.png, contrast.png |
||||
is an old attempt to write a configurator for these files. |
||||
@ -0,0 +1,3 @@ |
||||
[README.Desktop] |
||||
|
||||
|
||||
@ -0,0 +1,73 @@ |
||||
[README.KeyTab] |
||||
|
||||
The keytabs offered in the Options/Keyboard menu are |
||||
taken from from configurations files with a *.keytab |
||||
pattern either located in $KDEDIR/share/apps/konsole |
||||
or ~/.kde/share/apps/konsole. |
||||
|
||||
Keytabs allow to configure the behavior of konsole |
||||
on keyboard events, especially for functions keys. |
||||
Please have a look into the README.keyboard file, too. |
||||
|
||||
The syntax is that each entry has the form : |
||||
|
||||
"key" Keyname { ("+"|"-") Modename } ":" (String|Operation) |
||||
|
||||
Keynames are those defined in <qnamespace.h> with the |
||||
"Qt::Key_" prefix removed. |
||||
|
||||
Mode names are: |
||||
|
||||
- Shift : Shift Key pressed |
||||
- Alt : Alt Key pressed |
||||
- Control : Control Key pressed |
||||
|
||||
( The VT100 emulation has modes that can affect the |
||||
sequences emitted by certain keys. These modes are |
||||
under control of the client program. |
||||
|
||||
- Newline : effects Return and Enter key. |
||||
- Application : effects Up and Down key. |
||||
- Ansi : effects Up and Down key (This is for VT52, really). |
||||
|
||||
Since sending a state to a program that has set the state |
||||
itself is positivly wrong and obsolete design, better forget |
||||
about this nasty detail. I may well remove this "feature" |
||||
in a future clean up round. ) |
||||
|
||||
A "+" preceeding a Modename means the Key is pressed. |
||||
A "-" preceeding a Modename means the Key is not pressed. |
||||
If no mode is given it means don't care. |
||||
|
||||
Note that the combination of Key and Modes (set/reset) |
||||
has to be unique. This means, that |
||||
|
||||
key A + Shift : "A" |
||||
key A : "a" |
||||
|
||||
will not accept the small letter "a" rule as expected, |
||||
one has to add a "- Shift" to the last clause. Use |
||||
the stdout/stderr dianostics of konsole when modifying |
||||
keytabs to find problems like this. |
||||
|
||||
Operations are |
||||
|
||||
- prevSession : change to the previous session, if any |
||||
- nextSession : change to the next session, if any |
||||
- scrollUpLine : scroll up one line in the history log |
||||
- scrollUpPage : scroll up one page in the history log |
||||
- scrollDownLine : scroll down one line in the history log |
||||
- scrollDownPage : scroll down one page in the history log |
||||
- emitSelection : "paste" the current selection |
||||
|
||||
Strings have the syntax of C strings, |
||||
one may use the following escapes: |
||||
|
||||
- \E - escape |
||||
- \\ - backslash |
||||
- \" - double quote |
||||
- \t - tab |
||||
- \r - return |
||||
- \n - newline |
||||
- \b - backspace |
||||
- \xHH - where HH are two hex digits |
||||
@ -1,49 +0,0 @@ |
||||
/*
|
||||
makes vga font for X11 |
||||
|
||||
use with font specification from /usr/src/linux/drivers/video/font_*.c |
||||
|
||||
usage: makefont > linux8x16.bdf |
||||
bdftopcf -o linux8x16.pcf linux8x16.bdf |
||||
gzip linux8x16.pcf |
||||
|
||||
use X Y A with |
||||
8 8 1 font_8x8 |
||||
6 11 3 font_6x11.c |
||||
8 16 4 font_8x16.c |
||||
*/ |
||||
|
||||
/* insert font file here */ |
||||
|
||||
#define X 6 |
||||
#define Y 11 |
||||
#define A 3 |
||||
|
||||
main() |
||||
{ int i,j; |
||||
printf("STARTFONT 2.1\n"); |
||||
printf("COMMENT Linux console font %dx%d\n",X,Y); |
||||
printf("FONT linux%dx%d\n",X,Y); |
||||
printf("SIZE 8 75 75\n"); |
||||
printf("FONTBOUNDINGBOX %d %d 0 %d\n",X,Y,-A); |
||||
printf("STARTPROPERTIES 2\n"); |
||||
printf("FONT_DESCENT %d\n",A); |
||||
printf("FONT_ASCENT %d\n",X-A); |
||||
printf("ENDPROPERTIES\n"); |
||||
printf("CHARS 256\n"); |
||||
for (i = 0; i < 256; i++) |
||||
{ |
||||
printf("STARTCHAR x%02x\n",i); |
||||
printf("ENCODING %d\n",i); |
||||
printf("SWIDTH %d %d\n",0,0); |
||||
printf("DWIDTH %d %d\n",X,0); |
||||
printf("BBX %d %d %d %d\n",X,Y,0,-A); |
||||
printf("BITMAP\n"); |
||||
for (j = 0; j < Y; j++) |
||||
{ |
||||
printf("%02x\n",(unsigned char)fontdata_6x11[Y*i+j]); |
||||
} |
||||
printf("ENDCHAR x%02x\n",i); |
||||
} |
||||
printf("ENDFONT\n"); |
||||
} |
||||
@ -1,120 +0,0 @@ |
||||
NOTE: this is most probably broken, better keep hands off here. |
||||
|
||||
--- TEWidget.C Wed May 6 19:05:54 1998 |
||||
+++ TEWidget.C-withANY_FONT Wed May 6 19:02:21 1998 |
||||
@@ -184,6 +184,9 @@ |
||||
QPainter paint; |
||||
setUpdatesEnabled(FALSE); |
||||
paint.begin( this ); |
||||
+#ifdef ANY_FONT |
||||
+ paint.setBackgroundMode( TransparentMode ); |
||||
+#endif |
||||
|
||||
QPoint tL = contentsRect().topLeft(); |
||||
int tLx = tL.x(); |
||||
@@ -225,6 +228,14 @@ |
||||
disstr[len] = ext[x+len].c; |
||||
} |
||||
//printf("draw: %d %d %d\n",y,x,len); |
||||
+#ifdef ANY_FONT |
||||
+ cb = ext[x].b; |
||||
+ if (!pm || cb != DEFAULT_BACK_COLOR) |
||||
+ paint.fillRect(blX+tLx+font_w*x,bY+tLy+font_h*y,font_w*len,font_h, |
||||
+ color_table[cb]); |
||||
+ else |
||||
+ erase(blX+tLx+font_w*x,bY+tLy+font_h*y,font_w*len,font_h); |
||||
+#else |
||||
if (ext[x].b != cb) |
||||
{ |
||||
cb = ext[x].b; |
||||
@@ -238,12 +249,23 @@ |
||||
} |
||||
if (pm && cb == DEFAULT_BACK_COLOR) |
||||
erase(blX+tLx+font_w*x,bY+tLy+font_h*y,font_w*len,font_h); |
||||
- paint.drawText(blX+tLx+font_w*x,bY+tLy+font_a+font_h*y, disstr,len); |
||||
- if (cr & RE_BOLD) |
||||
- paint.drawText(blX+tLx+font_w*x+1,bY+tLy+font_a+font_h*y, disstr,len); |
||||
- if (cr & RE_UNDERLINE) |
||||
- paint.drawLine(blX+tLx+font_w*x, bY+tLy+font_a+font_h*y+1, |
||||
- blX+tLx+font_w*(x+len),bY+tLy+font_a+font_h*y+1 ); |
||||
+#endif |
||||
+#ifdef ANY_FONT |
||||
+ if (fixed_font) |
||||
+ { |
||||
+#endif |
||||
+ paint.drawText(blX+tLx+font_w*x,bY+tLy+font_a+font_h*y, disstr,len); |
||||
+ if (cr & RE_BOLD) |
||||
+ paint.drawText(blX+tLx+font_w*x+1,bY+tLy+font_a+font_h*y, disstr,len); |
||||
+ if (cr & RE_UNDERLINE) |
||||
+ paint.drawLine(blX+tLx+font_w*x, bY+tLy+font_a+font_h*y+1, |
||||
+ blX+tLx+font_w*(x+len),bY+tLy+font_a+font_h*y+1 ); |
||||
+#ifdef ANY_FONT |
||||
+ } |
||||
+ else // proportional font |
||||
+ for (int i = 0; i < len; i++) |
||||
+ paint.drawText(blX+tLx+font_w*(x+i),bY+tLy+font_a+font_h*y, disstr+i,1); |
||||
+#endif |
||||
x += len - 1; |
||||
} |
||||
} |
||||
@@ -310,6 +332,13 @@ |
||||
{ |
||||
disstr[len] = image[loc(x+len,y)].c; len += 1; |
||||
} |
||||
+#ifdef ANY_FONT |
||||
+ if (!pm || cb != DEFAULT_BACK_COLOR) |
||||
+ paint.fillRect(blX+tLx+font_w*x,bY+tLy+font_h*y,font_w*len,font_h, |
||||
+ color_table[cb]); |
||||
+ else |
||||
+ erase(blX+tLx+font_w*x,bY+tLy+font_h*y,font_w*len,font_h); |
||||
+#else |
||||
if (!pm || cb != DEFAULT_BACK_COLOR) |
||||
{ |
||||
if (blinking) |
||||
@@ -326,14 +355,25 @@ |
||||
paint.setBackgroundMode( TransparentMode ); |
||||
erase(blX+tLx+font_w*x,bY+tLy+font_h*y,font_w*len,font_h); |
||||
} |
||||
+#endif |
||||
if (!blinking || !(cr & RE_BLINK)) |
||||
{ |
||||
- paint.drawText(blX+tLx+font_w*x,bY+tLy+font_a+font_h*y, disstr,len); |
||||
- if (cr & RE_BOLD) |
||||
- paint.drawText(blX+tLx+font_w*x+1,bY+tLy+font_a+font_h*y, disstr,len); |
||||
- if (cr & RE_UNDERLINE) |
||||
- paint.drawLine(blX+tLx+font_w*x, bY+tLy+font_a+font_h*y+1, |
||||
- blX+tLx+font_w*(x+len),bY+tLy+font_a+font_h*y+1 ); |
||||
+#ifdef ANY_FONT |
||||
+ if (fixed_font) |
||||
+ { |
||||
+#endif |
||||
+ paint.drawText(blX+tLx+font_w*x,bY+tLy+font_a+font_h*y, disstr,len); |
||||
+ if (cr & RE_BOLD) |
||||
+ paint.drawText(blX+tLx+font_w*x+1,bY+tLy+font_a+font_h*y, disstr,len); |
||||
+ if (cr & RE_UNDERLINE) |
||||
+ paint.drawLine(blX+tLx+font_w*x, bY+tLy+font_a+font_h*y+1, |
||||
+ blX+tLx+font_w*(x+len),bY+tLy+font_a+font_h*y+1 ); |
||||
+#ifdef ANY_FONT |
||||
+ } |
||||
+ else // proportional font |
||||
+ for (int i = 0; i < len; i++) |
||||
+ paint.drawText(blX+tLx+font_w*(x+i),bY+tLy+font_a+font_h*y, disstr+i,1); |
||||
+#endif |
||||
} |
||||
x += len - 1; |
||||
} |
||||
@@ -458,6 +498,14 @@ |
||||
font_h = fontMetrics().height(); |
||||
font_w = fontMetrics().maxWidth(); |
||||
font_a = fontMetrics().ascent(); |
||||
+#ifdef ANY_FONT |
||||
+ //FIXME: this is broken. QT returns false for "9x15"! |
||||
+ // anyway, the option is deactivated by default |
||||
+ // and the bug will only harm a speed penalty. |
||||
+ fixed_font = fontInfo().fixedPitch(); |
||||
+#else |
||||
+ fixed_font = TRUE; |
||||
+#endif |
||||
|
||||
setMinimumSize(blX+brX+5*font_w,2*bY+5*font_h); |
||||
|
||||
@ -1,506 +0,0 @@ |
||||
NOTE: do not try to apply this patch. It is internal material
|
||||
|
||||
diff -ur konsole-latest/CVS/Entries konsole-xxx/CVS/Entries
|
||||
--- konsole-latest/CVS/Entries Sun Dec 20 12:35:22 1998
|
||||
+++ konsole-xxx/CVS/Entries Wed Dec 9 13:27:06 1998
|
||||
@@ -10,4 +10,9 @@
|
||||
/README.color.schema/1.1/Sat Nov 7 08:12:45 1998//
|
||||
/README.linux.console/1.8/Thu Nov 5 06:21:33 1998//
|
||||
/TODO/1.6/Mon Nov 23 12:11:42 1998//
|
||||
-D
|
||||
+D/config////
|
||||
+D/doc////
|
||||
+D/include////
|
||||
+D/other////
|
||||
+D/src////
|
||||
+D/tests////
|
||||
Only in konsole-latest/CVS: Entries.Log
|
||||
Only in konsole-xxx: Makefile
|
||||
Only in konsole-xxx: Makefile.in
|
||||
diff -ur konsole-latest/config/CVS/Entries konsole-xxx/config/CVS/Entries
|
||||
--- konsole-latest/config/CVS/Entries Sun Dec 20 12:35:22 1998
|
||||
+++ konsole-xxx/config/CVS/Entries Wed Dec 9 13:11:28 1998
|
||||
@@ -1 +1,2 @@
|
||||
-D
|
||||
+D/static////
|
||||
+D/var////
|
||||
Only in konsole-latest/config/CVS: Entries.Log
|
||||
diff -ur konsole-latest/doc/CVS/Entries konsole-xxx/doc/CVS/Entries
|
||||
--- konsole-latest/doc/CVS/Entries Sun Dec 20 12:35:24 1998
|
||||
+++ konsole-xxx/doc/CVS/Entries Wed Dec 9 13:11:28 1998
|
||||
@@ -5,4 +5,6 @@
|
||||
/histBuffer/1.1.1.1/Wed Oct 28 05:22:37 1998//
|
||||
/missing.codes/1.1.1.1/Wed Oct 28 05:22:37 1998//
|
||||
/missing.keys/1.1.1.1/Wed Oct 28 05:22:37 1998//
|
||||
-D
|
||||
+D/More////
|
||||
+D/VT100////
|
||||
+D/sgml////
|
||||
Only in konsole-latest/doc/CVS: Entries.Log
|
||||
Only in konsole-xxx/doc: Makefile
|
||||
Only in konsole-xxx/doc: Makefile.in
|
||||
diff -ur konsole-latest/doc/More/CVS/Entries konsole-xxx/doc/More/CVS/Entries
|
||||
--- konsole-latest/doc/More/CVS/Entries Sun Dec 20 12:35:58 1998
|
||||
+++ konsole-xxx/doc/More/CVS/Entries Mon Dec 14 04:52:45 1998
|
||||
@@ -5,7 +5,6 @@
|
||||
/dec_vt100_codes.txt/1.1.1.1/Wed Oct 28 05:22:37 1998//
|
||||
/iowa_vt100_news.txt/1.1.1.1/Wed Oct 28 05:22:37 1998//
|
||||
/k95vtnttn.html/1.1.1.1/Wed Oct 28 05:22:37 1998//
|
||||
-/rxvt-ref.html/1.1/Mon Dec 14 03:48:10 1998//
|
||||
/swedish_vt102_codes.txt/1.1.1.1/Wed Oct 28 05:22:37 1998//
|
||||
/villanova-vt100-esc-codes.txt/1.1.1.1/Wed Oct 28 05:22:37 1998//
|
||||
/vt100_codes_news.txt/1.1.1.1/Wed Oct 28 05:22:37 1998//
|
||||
@@ -16,4 +15,5 @@
|
||||
/vt100_setup.txt/1.1.1.1/Wed Oct 28 05:22:37 1998//
|
||||
/vttest.html/1.1.1.1/Wed Oct 28 05:22:37 1998//
|
||||
/xterm.codes/1.1.1.1/Wed Oct 28 05:22:37 1998//
|
||||
+/rxvt-ref.html/1.1/Fri Dec 11 21:49:44 1998//
|
||||
D
|
||||
diff -ur konsole-latest/doc/VT100/CVS/Entries konsole-xxx/doc/VT100/CVS/Entries
|
||||
--- konsole-latest/doc/VT100/CVS/Entries Sun Dec 20 12:36:32 1998
|
||||
+++ konsole-xxx/doc/VT100/CVS/Entries Mon Dec 14 04:39:53 1998
|
||||
@@ -9,6 +9,6 @@
|
||||
/genDocument/1.5/Thu Dec 3 23:01:24 1998//
|
||||
/genTC.pl/1.6/Fri Dec 4 15:37:32 1998//
|
||||
/t.pl/1.1.1.1/Wed Oct 28 05:22:38 1998//
|
||||
-/techref.html/1.7/Fri Dec 4 15:37:33 1998//
|
||||
/vt100.gif/1.2/Thu Nov 26 07:56:13 1998//
|
||||
+/techref.html/1.7/Thu Dec 10 00:30:03 1998//
|
||||
D
|
||||
Only in konsole-xxx/doc/VT100: Makefile
|
||||
Only in konsole-xxx/doc/VT100: Makefile.in
|
||||
Only in konsole-xxx/doc/sgml: Makefile
|
||||
Only in konsole-xxx/doc/sgml: Makefile.in
|
||||
diff -ur konsole-latest/include/CVS/Entries konsole-xxx/include/CVS/Entries
|
||||
--- konsole-latest/include/CVS/Entries Sun Dec 20 12:36:41 1998
|
||||
+++ konsole-xxx/include/CVS/Entries Mon Dec 14 05:09:15 1998
|
||||
@@ -7,7 +7,7 @@
|
||||
/TEmuVt102.h/1.5/Mon Nov 30 12:12:50 1998//
|
||||
/TEmulation.h/1.4/Mon Nov 30 12:12:52 1998//
|
||||
/kcmkonsole.h/1.6/Tue Nov 10 10:35:06 1998//
|
||||
-/main.h/1.11/Mon Dec 14 03:59:24 1998//
|
||||
/schema.h/1.1/Fri Nov 6 04:35:48 1998//
|
||||
/session.h/1.5/Mon Nov 9 08:55:38 1998//
|
||||
+/main.h/1.11/Mon Dec 14 04:07:42 1998//
|
||||
D
|
||||
Only in konsole-xxx/include: Makefile
|
||||
Only in konsole-xxx/include: Makefile.in
|
||||
diff -ur konsole-latest/include/TEShell.h konsole-xxx/include/TEShell.h
|
||||
--- konsole-latest/include/TEShell.h Sun Nov 1 19:47:42 1998
|
||||
+++ konsole-xxx/include/TEShell.h Mon Dec 14 13:18:42 1998
|
||||
@@ -30,9 +30,11 @@
|
||||
public:
|
||||
Shell(int login_shell);
|
||||
~Shell();
|
||||
+ static void killall();
|
||||
|
||||
public:
|
||||
int run(char* argv[], const char* term);
|
||||
+ void kill();
|
||||
|
||||
signals:
|
||||
void done(int status);
|
||||
@@ -63,9 +65,13 @@
|
||||
private:
|
||||
|
||||
void makeShell(const char* dev, char* argv[], const char* term);
|
||||
+ int openShell();
|
||||
|
||||
private:
|
||||
|
||||
+ char ptynam[11]; // "/dev/pty??";
|
||||
+ char ttynam[11]; // "/dev/tty??";
|
||||
+ pid_t processid;
|
||||
int fd;
|
||||
struct termios tp;
|
||||
int login_shell;
|
||||
diff -ur konsole-latest/include/main.h konsole-xxx/include/main.h
|
||||
--- konsole-latest/include/main.h Mon Dec 14 04:59:24 1998
|
||||
+++ konsole-xxx/include/main.h Mon Dec 14 14:05:27 1998
|
||||
@@ -32,7 +32,7 @@
|
||||
|
||||
public:
|
||||
|
||||
- TEDemo(const char* args[], int login_shell);
|
||||
+ TEDemo(const char* args[], int login_shell, int sec);
|
||||
~TEDemo();
|
||||
void setColLin(int columns, int lines);
|
||||
|
||||
@@ -58,6 +58,8 @@
|
||||
void setHeader();
|
||||
void changeTitle(int,char*s);
|
||||
void onDrop( KDNDDropZone* _zone );
|
||||
+
|
||||
+ void massacre();
|
||||
|
||||
protected:
|
||||
|
||||
@@ -67,6 +69,7 @@
|
||||
private slots:
|
||||
|
||||
void setSchema(int n);
|
||||
+ virtual bool queryExit();
|
||||
|
||||
private:
|
||||
|
||||
diff -ur konsole-latest/other/CVS/Entries konsole-xxx/other/CVS/Entries
|
||||
--- konsole-latest/other/CVS/Entries Sun Dec 20 12:36:51 1998
|
||||
+++ konsole-xxx/other/CVS/Entries Mon Dec 14 04:50:27 1998
|
||||
@@ -6,7 +6,6 @@
|
||||
/GreenOnBlack.schema/1.1.1.1/Wed Oct 28 05:22:38 1998//
|
||||
/LightPicture.schema/1.1/Sat Dec 5 22:42:41 1998//
|
||||
/Linux.schema/1.1/Thu Nov 5 02:04:44 1998//
|
||||
-/Makefile.am/1.9/Mon Dec 14 03:45:47 1998//
|
||||
/WhiteOnBlack.schema/1.1.1.1/Wed Oct 28 05:22:38 1998//
|
||||
/XTerm.schema/1.1/Thu Nov 5 02:04:47 1998//
|
||||
/brightness.xpm/1.1/Tue Nov 10 08:50:05 1998//
|
||||
@@ -15,15 +14,16 @@
|
||||
/default.Schema/1.1.1.1/Wed Oct 28 05:22:38 1998//
|
||||
/konsole-mini.xpm/1.2/Wed Nov 25 21:59:00 1998//
|
||||
/konsole.xpm/1.2/Wed Nov 25 21:59:02 1998//
|
||||
-/linux.kdelnk/1.7/Thu Dec 17 13:22:48 1998//
|
||||
/linux8x16.pcf.gz/1.1/Thu Oct 29 04:40:27 1998//
|
||||
/linux8x8.pcf.gz/1.1/Thu Nov 5 06:21:45 1998//
|
||||
/makefont.c/1.2/Thu Nov 5 06:21:45 1998//
|
||||
-/mc.kdelnk/1.5/Sun Dec 13 14:25:47 1998//
|
||||
/patch-anyfont/1.1.1.1/Wed Oct 28 05:22:39 1998//
|
||||
-/shell.kdelnk/1.5/Sun Dec 13 14:25:48 1998//
|
||||
/syscolor.schema/1.1/Thu Oct 29 16:49:19 1998//
|
||||
/vga.pcf.gz/1.1.1.1/Wed Oct 28 05:22:39 1998//
|
||||
/vim.schema/1.1/Fri Nov 27 18:10:47 1998//
|
||||
/xterm.ti/1.1.1.1/Wed Oct 28 05:22:39 1998//
|
||||
+/linux.kdelnk/1.6/Mon Dec 14 03:39:53 1998//
|
||||
+/mc.kdelnk/1.5/Mon Dec 14 03:39:53 1998//
|
||||
+/shell.kdelnk/1.5/Mon Dec 14 03:39:53 1998//
|
||||
+/Makefile.am/1.9/Mon Dec 14 03:48:41 1998//
|
||||
D
|
||||
Only in konsole-xxx/other: Makefile
|
||||
Only in konsole-xxx/other: Makefile.in
|
||||
diff -ur konsole-latest/other/linux.kdelnk konsole-xxx/other/linux.kdelnk
|
||||
--- konsole-latest/other/linux.kdelnk Thu Dec 17 14:22:48 1998
|
||||
+++ konsole-xxx/other/linux.kdelnk Mon Dec 14 04:39:53 1998
|
||||
@@ -3,7 +3,6 @@
|
||||
Type=KonsoleApplication
|
||||
Name=Linux
|
||||
Comment=Linux Console
|
||||
-Comment[cs]=Linuxová konzole
|
||||
Comment[es]=Consola Linux
|
||||
Comment[no]=Linux-konsoll
|
||||
Comment[pt_BR]=Console do Linux
|
||||
Only in konsole-xxx/src: .deps
|
||||
diff -ur konsole-latest/src/CVS/Entries konsole-xxx/src/CVS/Entries
|
||||
--- konsole-latest/src/CVS/Entries Sun Dec 20 12:37:14 1998
|
||||
+++ konsole-xxx/src/CVS/Entries Mon Dec 14 05:09:15 1998
|
||||
@@ -6,7 +6,7 @@
|
||||
/TEmuVt102.C/1.7/Fri Dec 4 00:43:23 1998//
|
||||
/TEmulation.C/1.3/Sat Nov 14 21:54:32 1998//
|
||||
/kcmkonsole.C/1.15/Mon Nov 30 12:12:54 1998//
|
||||
-/main.C/1.32/Mon Dec 14 04:00:46 1998//
|
||||
/schema.C/1.2/Fri Nov 27 18:10:49 1998//
|
||||
/session.C/1.6/Mon Nov 9 08:55:46 1998//
|
||||
+/main.C/1.32/Mon Dec 14 04:07:55 1998//
|
||||
D
|
||||
Only in konsole-xxx/src: Makefile
|
||||
Only in konsole-xxx/src: Makefile.in
|
||||
Only in konsole-xxx/src: TEScreen.o
|
||||
diff -ur konsole-latest/src/TEShell.C konsole-xxx/src/TEShell.C
|
||||
--- konsole-latest/src/TEShell.C Thu Nov 26 08:56:38 1998
|
||||
+++ konsole-xxx/src/TEShell.C Mon Dec 14 15:34:23 1998
|
||||
@@ -36,6 +36,7 @@
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/ioctl.h>
|
||||
+#include <sys/stat.h>
|
||||
#include <grp.h>
|
||||
#include "../../config.h"
|
||||
|
||||
@@ -60,6 +61,93 @@
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
+// Following class has a single instance.
|
||||
+// It forms a trivial client/server pair connected via pipes.
|
||||
+// The server is responsible to claim and release the rights on the tty line.
|
||||
+// It has been separated for security reasons, since this is the only part of
|
||||
+// the program running root.
|
||||
+
|
||||
+class Helper
|
||||
+{
|
||||
+ int toserver[2]; // 0 reading, 1 writing.
|
||||
+ int toclient[2]; // 0 reading, 1 writing.
|
||||
+
|
||||
+public:
|
||||
+
|
||||
+ Helper()
|
||||
+ {
|
||||
+ assert(!pipe(toserver));
|
||||
+ assert(!pipe(toclient));
|
||||
+ int pid = fork();
|
||||
+ if (pid == 0)
|
||||
+ {
|
||||
+ // This part of the program stays root/suid.
|
||||
+ while(1)
|
||||
+ { char buffer[100]; char ttynam[] = "/dev/tty??";
|
||||
+ // we assume to receive everything in on piece
|
||||
+ int len = read(toserver[0],buffer,sizeof(buffer)-1);
|
||||
+ buffer[len] = 0;
|
||||
+ if (sscanf(buffer,"get /dev/tty%c%c\n",ttynam+8,ttynam+9) == 2)
|
||||
+ {
|
||||
+ chown(ttynam,getuid(),getgid()); chmod(ttynam,0600);
|
||||
+ }
|
||||
+ else
|
||||
+ if (sscanf(buffer,"drop /dev/tty%c%c\n",ttynam+8,ttynam+9) == 2)
|
||||
+ {
|
||||
+ chown(ttynam,0,0); chmod(ttynam,0666);
|
||||
+ }
|
||||
+ else
|
||||
+ if (!strcmp(buffer,"quit\n"))
|
||||
+ {
|
||||
+printf("quitting\n");
|
||||
+ exit(1);
|
||||
+ }
|
||||
+ else
|
||||
+ printf("konsole: Helper does not understand '%s'.\n",buffer);
|
||||
+ write(toclient[1],"\n",1); // sync
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ ~Helper()
|
||||
+ {
|
||||
+ }
|
||||
+
|
||||
+ // client
|
||||
+
|
||||
+ void getTty(char* dev)
|
||||
+ // called after finding a usable pty.
|
||||
+ {
|
||||
+ assert(strlen(dev) == 10);
|
||||
+ char buffer[100];
|
||||
+ sprintf(buffer,"get %s\n",dev);
|
||||
+ write(toserver[1],buffer,strlen(buffer)+1);
|
||||
+ read(toclient[0],buffer,1); // wait for sync
|
||||
+ }
|
||||
+
|
||||
+ void dropTty(char* dev)
|
||||
+ // called when done.
|
||||
+ {
|
||||
+ assert(strlen(dev) == 10);
|
||||
+ char buffer[100];
|
||||
+ sprintf(buffer,"drop %s\n",dev);
|
||||
+ write(toserver[1],buffer,strlen(buffer)+1);
|
||||
+ read(toclient[0],buffer,1); // wait for sync
|
||||
+ }
|
||||
+
|
||||
+ void quit()
|
||||
+ // called to terminate helper
|
||||
+ { char buffer[100];
|
||||
+ sprintf(buffer,"quit\n");
|
||||
+ write(toserver[1],buffer,strlen(buffer)+1);
|
||||
+ read(toclient[0],buffer,1); // wait for sync
|
||||
+ }
|
||||
+};
|
||||
+
|
||||
+static Helper helper;
|
||||
+
|
||||
+/* -------------------------------------------------------------------------- */
|
||||
+
|
||||
void Shell::setSize(int lines, int columns)
|
||||
// Tell the teletype handler what size the window is.
|
||||
// Called after a window size change.
|
||||
@@ -70,21 +158,21 @@
|
||||
ioctl(fd,TIOCSWINSZ,(char *)&wsize);
|
||||
}
|
||||
|
||||
-static char ptynam[] = "/dev/ptyxx";
|
||||
-static char ttynam[] = "/dev/ttyxx";
|
||||
-
|
||||
static QIntDict<Shell> shells;
|
||||
+static int forgetit = 0;
|
||||
|
||||
static void catchChild(int)
|
||||
// Catch a SIGCHLD signal and propagate that the child died.
|
||||
{ int status;
|
||||
pid_t pid = wait(&status);
|
||||
Shell* sh = shells.find(pid);
|
||||
- if (sh) { shells.remove(pid); sh->doneShell(status); }
|
||||
+ if (sh) { shells.remove(pid); sh->doneShell(forgetit?0:status); }
|
||||
}
|
||||
|
||||
void Shell::doneShell(int status)
|
||||
{
|
||||
+ helper.dropTty(ttynam);
|
||||
+printf("died %d\n",processid);
|
||||
emit done(status);
|
||||
}
|
||||
|
||||
@@ -93,7 +181,7 @@
|
||||
pid_t comm_pid = fork();
|
||||
if (comm_pid < 0) { fprintf(stderr,"Can't fork\n"); return -1; }
|
||||
if (comm_pid == 0) makeShell(ttynam,argv,term);
|
||||
- if (comm_pid > 0) shells.insert(comm_pid,this);
|
||||
+ if (comm_pid > 0) { shells.insert(comm_pid,this); processid = comm_pid; }
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -156,7 +244,7 @@
|
||||
exit(1); // control should never come here.
|
||||
}
|
||||
|
||||
-int openShell()
|
||||
+int Shell::openShell()
|
||||
{ int ptyfd; char *s3, *s4;
|
||||
static char ptyc3[] = "pqrstuvwxyzabcde";
|
||||
static char ptyc4[] = "0123456789abcdef";
|
||||
@@ -180,7 +268,7 @@
|
||||
}
|
||||
if (ptyfd < 0) { fprintf(stderr,"Can't open a pseudo teletype\n"); exit(1); }
|
||||
fcntl(ptyfd,F_SETFL,O_NDELAY);
|
||||
-
|
||||
+ helper.getTty(ttynam);
|
||||
return ptyfd;
|
||||
}
|
||||
|
||||
@@ -189,6 +277,9 @@
|
||||
{
|
||||
login_shell=ls;
|
||||
|
||||
+ ptynam = "/dev/ptyxx";
|
||||
+ ttynam = "/dev/ttyxx";
|
||||
+
|
||||
fd = openShell();
|
||||
|
||||
signal(SIGCHLD,catchChild);
|
||||
@@ -204,6 +295,24 @@
|
||||
delete mn;
|
||||
delete mw;
|
||||
close(fd);
|
||||
+}
|
||||
+
|
||||
+void Shell::killall()
|
||||
+{
|
||||
+ forgetit = 1;
|
||||
+ QIntDictIterator<Shell> it( shells ); // iterator for dict
|
||||
+ while ( it.current() )
|
||||
+ {
|
||||
+ it.current()->kill();
|
||||
+ ++it;
|
||||
+ }
|
||||
+ helper.quit();
|
||||
+}
|
||||
+
|
||||
+void Shell::kill()
|
||||
+{
|
||||
+printf("kill %d\n",processid);
|
||||
+ ::kill(processid,SIGHUP);
|
||||
}
|
||||
|
||||
void Shell::send_byte(char c)
|
||||
Only in konsole-xxx/src: TEShell.moc
|
||||
Only in konsole-xxx/src: TEShell.o
|
||||
Only in konsole-xxx/src: TEWidget.moc
|
||||
Only in konsole-xxx/src: TEWidget.o
|
||||
Only in konsole-xxx/src: TEmuVt102.moc
|
||||
Only in konsole-xxx/src: TEmuVt102.o
|
||||
Only in konsole-xxx/src: TEmulation.moc
|
||||
Only in konsole-xxx/src: TEmulation.o
|
||||
Only in konsole-xxx/src: kcmkonsole
|
||||
Only in konsole-xxx/src: kcmkonsole.moc
|
||||
Only in konsole-xxx/src: kcmkonsole.o
|
||||
Only in konsole-xxx/src: konsole
|
||||
Only in konsole-xxx/src: kwrite
|
||||
Only in konsole-xxx/src: libkonsole.a
|
||||
diff -ur konsole-latest/src/main.C konsole-xxx/src/main.C
|
||||
--- konsole-latest/src/main.C Mon Dec 14 05:00:46 1998
|
||||
+++ konsole-xxx/src/main.C Mon Dec 14 15:08:03 1998
|
||||
@@ -72,7 +72,7 @@
|
||||
static QIntDict<KSimpleConfig> no2command;
|
||||
static int cmd_serial = 0;
|
||||
|
||||
-TEDemo::TEDemo(const char* args[], int login_shell) : KTMainWindow()
|
||||
+TEDemo::TEDemo(const char* args[], int login_shell, int sec) : KTMainWindow()
|
||||
{
|
||||
se = NULL;
|
||||
title = PACKAGE;
|
||||
@@ -104,7 +104,7 @@
|
||||
|
||||
loadSessionCommands();
|
||||
m_file->insertSeparator();
|
||||
- m_file->insertItem( i18n("E&xit"), kapp, SLOT(quit()));
|
||||
+ m_file->insertItem( i18n("E&xit"), this, SLOT(massacre()));
|
||||
|
||||
// load schema /////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -138,6 +138,16 @@
|
||||
addSession(initial);
|
||||
|
||||
setColLin(lincol0.width(),lincol0.height());
|
||||
+
|
||||
+ if (sec)
|
||||
+ KMsgBox::message
|
||||
+ ( this,
|
||||
+ i18n("Security Warning"),
|
||||
+ QString(i18n("Konsole is not properly installed root/suid.")) +
|
||||
+ "\n" +
|
||||
+ i18n("This means you terminal line(s) cannot be secured."),
|
||||
+ KMsgBox::EXCLAMATION );
|
||||
+
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -560,7 +570,7 @@
|
||||
void TEDemo::about()
|
||||
//FIXME: make this a little nicer
|
||||
{
|
||||
- QString title, msg;
|
||||
+ QString title = "", msg = "";
|
||||
|
||||
title.sprintf(i18n("About %s"), PACKAGE);
|
||||
msg.sprintf(i18n(
|
||||
@@ -811,6 +821,8 @@
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
+ int sec = (geteuid() != 0);
|
||||
+
|
||||
setuid(getuid()); setgid(getgid()); // drop privileges
|
||||
|
||||
kimgioRegister(); // add io for additional image formats
|
||||
@@ -875,9 +887,9 @@
|
||||
}
|
||||
}
|
||||
if (a.isRestored())
|
||||
- RESTORE( TEDemo(eargs,login_shell) )
|
||||
+ RESTORE( TEDemo(eargs,login_shell,sec) )
|
||||
else {
|
||||
- TEDemo* m = new TEDemo(eargs,login_shell);
|
||||
+ TEDemo* m = new TEDemo(eargs,login_shell,sec);
|
||||
m->title = a.getCaption();
|
||||
if (strcmp("",sz) !=0) m->setColLin(c,l);
|
||||
if (welcome) m->setCaption(i18n("Welcome to the console"));
|
||||
@@ -886,6 +898,20 @@
|
||||
}
|
||||
|
||||
return a.exec();
|
||||
+}
|
||||
+
|
||||
+void TEDemo::massacre()
|
||||
+{
|
||||
+HERE;
|
||||
+ Shell::killall();
|
||||
+HERE;
|
||||
+ QTimer::singleShot(1000,kapp,SLOT(quit())); // just in case some child refused to die
|
||||
+}
|
||||
+
|
||||
+bool TEDemo::queryExit()
|
||||
+{
|
||||
+ massacre();
|
||||
+ return 0;
|
||||
}
|
||||
|
||||
#include "main.moc"
|
||||
Only in konsole-xxx/src: main.moc
|
||||
Only in konsole-xxx/src: main.o
|
||||
Only in konsole-xxx/src: schema.o
|
||||
Only in konsole-xxx/src: session.moc
|
||||
Only in konsole-xxx/src: session.o
|
||||
Binary file not shown.
@ -1,171 +0,0 @@ |
||||
############################################################################## |
||||
# # |
||||
# Enhanced xterm terminfo entry # |
||||
# # |
||||
# Install xterm.ti by typing tic xterm.ti # |
||||
# # |
||||
# This file originates from the mc-4.1.21 distribution. # |
||||
# # |
||||
############################################################################## |
||||
|
||||
############################################################################## |
||||
# # |
||||
# Basic xterm supports # |
||||
# # |
||||
############################################################################## |
||||
|
||||
xterm-basic|xterm terminal base (X Window System), |
||||
|
||||
# General Attributes ######################################################### |
||||
|
||||
# auto wrap around margin, special VT100 behavior to do so. |
||||
am, xenl, |
||||
|
||||
# has meta (Alt) key set 8th bit |
||||
# this is not wise to set, since we may have 8bit char sets |
||||
# km, |
||||
|
||||
# save to move while in insert/standout mode |
||||
mir, msgr, |
||||
|
||||
# nr. of lines, nr. of columns |
||||
# hmm, does not make very much sence with a resizeable terminal |
||||
lines#65, cols#80, |
||||
|
||||
# Erase overstrike with a blank. (BS only moves back in VT100) |
||||
eo, |
||||
|
||||
# Miscelaneous ############################################################### |
||||
|
||||
bel=^G, |
||||
cr=\r, |
||||
|
||||
# Erasing #################################################################### |
||||
|
||||
# Clear screen, EOL, EOS, BOL |
||||
clear=\E[2J, el=\E[K, ed=\E[J, el1=\E[1K, |
||||
|
||||
# Scrolling ################################################################## |
||||
|
||||
# Change scroll region |
||||
csr=\E[%i%p1%d;%p2%dr, |
||||
|
||||
# Scroll text up, down |
||||
ind=\ED, ri=\EM, |
||||
|
||||
# Tabulator ################################################################## |
||||
|
||||
# Set tab stops, clear tab stops, tab character |
||||
# FIXME: does xterm use \E[3k instead of \E[3g (like vt102)? |
||||
hts=\EH, tbc=\E[3g, ht=\t, |
||||
|
||||
# initial tab spaceing |
||||
it#8, |
||||
|
||||
# Insert/Delete ############################################################## |
||||
|
||||
# Enter insert mode, leave insert mode |
||||
smir=\E[4h, rmir=\E[4l, |
||||
|
||||
# Delete: chars, lines, 1char, 1line |
||||
dch=\E[%p1%dP, dl=\E[%p1%dM, |
||||
dch1=\E[P, dl1=\E[M, |
||||
|
||||
# Insert: chars, line, 1 char, |
||||
ich=\E[%p1%d@, il=\E[%p1%dL, |
||||
ich1=\E[@, il1=\E[L, |
||||
|
||||
# Rendition ################################################################## |
||||
|
||||
# Fonts: bold, reverse, blink, underline (enter/leave), |
||||
# standout (enter/leave), Define attribs 1-9 |
||||
bold=\E[1m, rev=\E[7m, |
||||
rmul=\E[24m, smul=\E[4m, rmso=\E[m, smso=\E[7m, |
||||
|
||||
# Code for line drawing, enter alternate char set and leave char set |
||||
acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~, |
||||
smacs=\E(B\E)U^N,rmacs=\E(B\E)0^O, |
||||
enacs=\E(B\E)0, |
||||
|
||||
# Cursor Movement ############################################################ |
||||
|
||||
# Make cursor invisible, normal |
||||
civis=\E[?25l, cnorm=\E[?25h, |
||||
|
||||
# Save cursor position, restore cursor position |
||||
sc=\E7, rc=\E8, |
||||
|
||||
# Positions Horizontal and vertical. |
||||
hpa=\E[%i%p1%dG, vpa=\E[%i%p1%dd, |
||||
|
||||
# Move cursor: 1 char, any |
||||
cuf1=\E[C, cuu1=\E[A, cud1=\n, cub1=\b, |
||||
cuf=\E[%p1%dC, cuu=\E[%p1%dA, cud=\E[%p1%dB, cub=\E[%p1%dD, |
||||
|
||||
# Move cursor to arbitrary position |
||||
cup=\E[%i%p1%d;%p2%dH, |
||||
|
||||
# Misc cursor motion |
||||
home=\E[H, |
||||
|
||||
# Keyboard ################################################################### |
||||
|
||||
# Enter/leave keypad transmit. |
||||
rmkx=\E[?1l\E>, |
||||
smkx=\E[?1h\E=, |
||||
|
||||
# Cursor keys, sent by terminal |
||||
kcuf1=\EOC, kcuu1=\EOA, kcud1=\EOB, kcub1=\EOD, |
||||
|
||||
# Other nice keys (keypad pos1, pgup, center, end, pgdn) |
||||
ka1=\EOq, ka3=\EOs, |
||||
kb2=\EOr, |
||||
kc1=\EOp, kc3=\EOn, |
||||
|
||||
# The Function keys. (F0 - F20) |
||||
|
||||
kf0=\E[21~, kf1=\E[11~, kf2=\E[12~, |
||||
kf3=\E[13~, kf4=\E[14~, kf5=\E[15~, kf6=\E[17~, |
||||
kf7=\E[18~, kf8=\E[19~, kf9=\E[20~, kf10=\E[21~, |
||||
kf11=\E[23~, kf12=\E[24~, kf13=\E[25~, kf14=\E[26~, |
||||
kf15=\E[28~, kf16=\E[29~, kf17=\E[31~, kf18=\E[32~, |
||||
kf19=\E[33~, kf20=\E[34~, |
||||
|
||||
# Insert, home, end, delete, next page, previous page, backspace, enter |
||||
kich1=\E[2~, khome=\E[H, kend=\E[F, |
||||
kdch1=\E[3~, knp=\E[6~, kpp=\E[5~, |
||||
kbs=\b, kent=\EOM, |
||||
|
||||
# Init/Reset ################################################################# |
||||
|
||||
# Reset terminal, turn off all attributes |
||||
rs1=\E>\E[1;3;4;5;6l\E[?7h\E[m\E[r\E[2J\E[H, |
||||
rs2=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;3;4;6l\E[4l\E<, |
||||
|
||||
# Init terminal |
||||
is2=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;3;4;6l\E[4l, |
||||
|
||||
# Leave/Enter CA-Mode. |
||||
rmcup=\E[?47l\E8, |
||||
smcup=\E7\E[?47h, |
||||
|
||||
############################################################################## |
||||
# # |
||||
# Xterm with color support. # |
||||
# # |
||||
############################################################################## |
||||
|
||||
xterm|vs100|xterm terminal emulator (X Window System), |
||||
use=xterm-basic, |
||||
sgr=\E[0%?%p1%p6%|%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;m%?%p9%t^N%e^O%;, |
||||
sgr0=\E[m^O, |
||||
|
||||
xterm-color|color-xterm|color xterm terminal emulator (X Window System), |
||||
use=xterm, |
||||
colors#8, pairs#64, |
||||
|
||||
# Set all color pairs to the original ones |
||||
op=\E[m, |
||||
|
||||
# Set foreground color, background color |
||||
setf=\E[%p1%{30}%+%dm, setb=\E[%p1%{40}%+%dm, |
||||
Loading…
Reference in new issue