Version 0.1.4 from FTP

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@218 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Mark Spencer
2000-10-25 23:22:50 +00:00
parent dc57c56065
commit b545125d11
3 changed files with 60 additions and 8 deletions

View File

@@ -48,6 +48,19 @@ static void urg_handler(int num)
return;
}
static void set_title(char *text)
{
/* Set an X-term or screen title */
if (getenv("TERM") && strstr(getenv("TERM"), "xterm"))
fprintf(stdout, "\033]2;%s\007", text);
}
static void set_icon(char *text)
{
if (getenv("TERM") && strstr(getenv("TERM"), "xterm"))
fprintf(stdout, "\033]1;%s\007", text);
}
static int set_priority(int pri)
{
struct sched_param sched;
@@ -210,6 +223,10 @@ int main(int argc, char *argv[])
if (option_console) {
/* Console stuff now... */
/* Register our quit function */
char title[256];
set_icon("Asterisk");
snprintf(title, sizeof(title), "Asterisk Console (pid %d)", getpid());
set_title(title);
ast_cli_register(&quit);
consolethread = pthread_self();
if (strlen(filename))