should fix bug #501, Terminal title can be set with special characters
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17250 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -6,6 +6,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include <ctype.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
@@ -776,10 +777,38 @@ TermParse::EscParse(void *data)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case CASE_OSC:
|
case CASE_OSC:
|
||||||
|
{
|
||||||
/* Operating System Command: ESC ] */
|
/* Operating System Command: ESC ] */
|
||||||
// do_osc(finput);
|
char string[512];
|
||||||
|
uint32 len = 0;
|
||||||
|
char mode_char = theObj->GetReaderBuf();
|
||||||
|
if (mode_char != '0'
|
||||||
|
&& mode_char != '1'
|
||||||
|
&& mode_char != '2') {
|
||||||
|
parsestate = groundtable;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
char current_char = theObj->GetReaderBuf();
|
||||||
|
while ((current_char = theObj->GetReaderBuf()) != 0x7) {
|
||||||
|
if (!isprint(current_char & 0x7f)
|
||||||
|
|| len+2 >= sizeof(string))
|
||||||
|
break;
|
||||||
|
string[len++] = current_char;
|
||||||
|
}
|
||||||
|
if (current_char == 0x7) {
|
||||||
|
string[len] = '\0';
|
||||||
|
switch (mode_char) {
|
||||||
|
case '0':
|
||||||
|
case '2':
|
||||||
|
theObj->fWinObj->SetTitle(string);
|
||||||
|
break;
|
||||||
|
case '1':
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
parsestate = groundtable;
|
parsestate = groundtable;
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case CASE_RIS: // ESC c ... Reset terminal.
|
case CASE_RIS: // ESC c ... Reset terminal.
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user