mirror of
https://github.com/weechat/weechat.git
synced 2026-07-02 07:46:38 +02:00
fix typo in gui_window_set_title
This commit is contained in:
@@ -3218,21 +3218,30 @@ gui_init_colors ()
|
||||
void
|
||||
gui_set_window_title ()
|
||||
{
|
||||
if (strcmp (getenv ("TERM"), "screen") == 0)
|
||||
printf ("\033k%s %s\033\\", PACKAGE_NAME, PACKAGE_VERSION);
|
||||
else if (strcmp( getenv ("TERM"), "sun-cmd") == 0)
|
||||
printf ("\033]l%s %s\033\\", PACKAGE_NAME, PACKAGE_VERSION);
|
||||
else if (strcmp( getenv ("TERM"), "hpterm") == 0)
|
||||
printf ("\033&f0k%dD%s %s", strlen(PACKAGE_NAME) +
|
||||
strlen(PACKAGE_VERSION) + 1,
|
||||
PACKAGE_NAME, PACKAGE_VERSION);
|
||||
/* the following term supports the xterm excapes */
|
||||
else if (strncmp (getenv ("TERM"), "xterm", 5) == 0
|
||||
|| strncmp (getenv ("TERM"), "rxvt", 4) == 0
|
||||
|| strcmp( getenv ("TERM"), "aixterm") == 0
|
||||
|| strcmp( getenv ("TERM"), "iris-ansi") == 0
|
||||
|| strcmp( getenv ("TERM"), "dtterm") == 0)
|
||||
printf ("\33]0;%s %s\7", PACKAGE_NAME, PACKAGE_VERSION);
|
||||
char *envterm = getenv ("TERM");
|
||||
|
||||
if (envterm)
|
||||
{
|
||||
if (strcmp( envterm, "sun-cmd") == 0)
|
||||
printf ("\033]l%s %s\033\\", PACKAGE_NAME, PACKAGE_VERSION);
|
||||
else if (strcmp(envterm, "hpterm") == 0)
|
||||
printf ("\033&f0k%dD%s %s", strlen(PACKAGE_NAME) +
|
||||
strlen(PACKAGE_VERSION) + 1,
|
||||
PACKAGE_NAME, PACKAGE_VERSION);
|
||||
/* the following term supports the xterm excapes */
|
||||
else if (strncmp (envterm, "xterm", 5) == 0
|
||||
|| strncmp (envterm, "rxvt", 4) == 0
|
||||
|| strcmp (envterm, "aixterm") == 0
|
||||
|| strcmp (envterm, "iris-ansi") == 0
|
||||
|| strcmp (envterm, "dtterm") == 0)
|
||||
printf ("\33]0;%s %s\7", PACKAGE_NAME, PACKAGE_VERSION);
|
||||
else if (strcmp (envterm, "screen") == 0)
|
||||
{
|
||||
printf ("\033k%s %s\033\\", PACKAGE_NAME, PACKAGE_VERSION);
|
||||
/* tryning to set the title of a backgrounded xterm like terminal */
|
||||
printf ("\33]0;%s %s\7", PACKAGE_NAME, PACKAGE_VERSION);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -3242,35 +3251,43 @@ gui_set_window_title ()
|
||||
void
|
||||
gui_reset_window_title ()
|
||||
{
|
||||
if (strcmp (getenv ("TERM"), "screen") == 0)
|
||||
char *envterm = getenv ("TERM");
|
||||
char *envshell = getenv ("SHELL");
|
||||
|
||||
if (envterm)
|
||||
{
|
||||
char *shell, *shellname;
|
||||
if (getenv ("SHELL"))
|
||||
if (strcmp( envterm, "sun-cmd") == 0)
|
||||
printf ("\033]l%s\033\\", "Terminal");
|
||||
else if (strcmp( envterm, "hpterm") == 0)
|
||||
printf ("\033&f0k%dD%s", strlen("Terminal"), "Terminal");
|
||||
/* the following term supports the xterm excapes */
|
||||
else if (strncmp (envterm, "xterm", 5) == 0
|
||||
|| strncmp (envterm, "rxvt", 4) == 0
|
||||
|| strcmp( envterm, "aixterm") == 0
|
||||
|| strcmp( envterm, "iris-ansi") == 0
|
||||
|| strcmp( envterm, "dtterm") == 0)
|
||||
printf ("\33]0;%s\7", "Terminal");
|
||||
else if (strcmp (envterm, "screen") == 0)
|
||||
{
|
||||
shell = strdup (getenv ("SHELL"));
|
||||
shellname = basename(shell);
|
||||
if (shell)
|
||||
char *shell, *shellname;
|
||||
if (envshell)
|
||||
{
|
||||
printf ("\033k%s\033\\", shellname);
|
||||
free (shell);
|
||||
shell = strdup (envterm);
|
||||
shellname = basename(shell);
|
||||
if (shell)
|
||||
{
|
||||
printf ("\033k%s\033\\", shellname);
|
||||
free (shell);
|
||||
}
|
||||
else
|
||||
printf ("\033k%s\033\\", envterm);
|
||||
}
|
||||
else
|
||||
printf ("\033k%s\033\\", getenv ("TERM"));
|
||||
printf ("\033k%s\033\\", envterm);
|
||||
/* tryning to reset the title of a backgrounded xterm like terminal */
|
||||
printf ("\33]0;%s\7", "Terminal");
|
||||
}
|
||||
else
|
||||
printf ("\033k%s\033\\", getenv ("TERM"));
|
||||
}
|
||||
else if (strcmp( getenv ("TERM"), "sun-cmd") == 0)
|
||||
printf ("\033]l%s\033\\", "Terminal");
|
||||
else if (strcmp( getenv ("TERM"), "hpterm") == 0)
|
||||
printf ("\033&f0k%dD%s", strlen("Terminal"), "Terminal");
|
||||
/* the following term supports the xterm excapes */
|
||||
else if (strncmp (getenv ("TERM"), "xterm", 5) == 0
|
||||
|| strncmp (getenv ("TERM"), "rxvt", 4) == 0
|
||||
|| strcmp( getenv ("TERM"), "aixterm") == 0
|
||||
|| strcmp( getenv ("TERM"), "iris-ansi") == 0
|
||||
|| strcmp( getenv ("TERM"), "dtterm") == 0)
|
||||
printf ("\33]0;%s\7", "Terminal");
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -3218,21 +3218,30 @@ gui_init_colors ()
|
||||
void
|
||||
gui_set_window_title ()
|
||||
{
|
||||
if (strcmp (getenv ("TERM"), "screen") == 0)
|
||||
printf ("\033k%s %s\033\\", PACKAGE_NAME, PACKAGE_VERSION);
|
||||
else if (strcmp( getenv ("TERM"), "sun-cmd") == 0)
|
||||
printf ("\033]l%s %s\033\\", PACKAGE_NAME, PACKAGE_VERSION);
|
||||
else if (strcmp( getenv ("TERM"), "hpterm") == 0)
|
||||
printf ("\033&f0k%dD%s %s", strlen(PACKAGE_NAME) +
|
||||
strlen(PACKAGE_VERSION) + 1,
|
||||
PACKAGE_NAME, PACKAGE_VERSION);
|
||||
/* the following term supports the xterm excapes */
|
||||
else if (strncmp (getenv ("TERM"), "xterm", 5) == 0
|
||||
|| strncmp (getenv ("TERM"), "rxvt", 4) == 0
|
||||
|| strcmp( getenv ("TERM"), "aixterm") == 0
|
||||
|| strcmp( getenv ("TERM"), "iris-ansi") == 0
|
||||
|| strcmp( getenv ("TERM"), "dtterm") == 0)
|
||||
printf ("\33]0;%s %s\7", PACKAGE_NAME, PACKAGE_VERSION);
|
||||
char *envterm = getenv ("TERM");
|
||||
|
||||
if (envterm)
|
||||
{
|
||||
if (strcmp( envterm, "sun-cmd") == 0)
|
||||
printf ("\033]l%s %s\033\\", PACKAGE_NAME, PACKAGE_VERSION);
|
||||
else if (strcmp(envterm, "hpterm") == 0)
|
||||
printf ("\033&f0k%dD%s %s", strlen(PACKAGE_NAME) +
|
||||
strlen(PACKAGE_VERSION) + 1,
|
||||
PACKAGE_NAME, PACKAGE_VERSION);
|
||||
/* the following term supports the xterm excapes */
|
||||
else if (strncmp (envterm, "xterm", 5) == 0
|
||||
|| strncmp (envterm, "rxvt", 4) == 0
|
||||
|| strcmp (envterm, "aixterm") == 0
|
||||
|| strcmp (envterm, "iris-ansi") == 0
|
||||
|| strcmp (envterm, "dtterm") == 0)
|
||||
printf ("\33]0;%s %s\7", PACKAGE_NAME, PACKAGE_VERSION);
|
||||
else if (strcmp (envterm, "screen") == 0)
|
||||
{
|
||||
printf ("\033k%s %s\033\\", PACKAGE_NAME, PACKAGE_VERSION);
|
||||
/* tryning to set the title of a backgrounded xterm like terminal */
|
||||
printf ("\33]0;%s %s\7", PACKAGE_NAME, PACKAGE_VERSION);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -3242,35 +3251,43 @@ gui_set_window_title ()
|
||||
void
|
||||
gui_reset_window_title ()
|
||||
{
|
||||
if (strcmp (getenv ("TERM"), "screen") == 0)
|
||||
char *envterm = getenv ("TERM");
|
||||
char *envshell = getenv ("SHELL");
|
||||
|
||||
if (envterm)
|
||||
{
|
||||
char *shell, *shellname;
|
||||
if (getenv ("SHELL"))
|
||||
if (strcmp( envterm, "sun-cmd") == 0)
|
||||
printf ("\033]l%s\033\\", "Terminal");
|
||||
else if (strcmp( envterm, "hpterm") == 0)
|
||||
printf ("\033&f0k%dD%s", strlen("Terminal"), "Terminal");
|
||||
/* the following term supports the xterm excapes */
|
||||
else if (strncmp (envterm, "xterm", 5) == 0
|
||||
|| strncmp (envterm, "rxvt", 4) == 0
|
||||
|| strcmp( envterm, "aixterm") == 0
|
||||
|| strcmp( envterm, "iris-ansi") == 0
|
||||
|| strcmp( envterm, "dtterm") == 0)
|
||||
printf ("\33]0;%s\7", "Terminal");
|
||||
else if (strcmp (envterm, "screen") == 0)
|
||||
{
|
||||
shell = strdup (getenv ("SHELL"));
|
||||
shellname = basename(shell);
|
||||
if (shell)
|
||||
char *shell, *shellname;
|
||||
if (envshell)
|
||||
{
|
||||
printf ("\033k%s\033\\", shellname);
|
||||
free (shell);
|
||||
shell = strdup (envterm);
|
||||
shellname = basename(shell);
|
||||
if (shell)
|
||||
{
|
||||
printf ("\033k%s\033\\", shellname);
|
||||
free (shell);
|
||||
}
|
||||
else
|
||||
printf ("\033k%s\033\\", envterm);
|
||||
}
|
||||
else
|
||||
printf ("\033k%s\033\\", getenv ("TERM"));
|
||||
printf ("\033k%s\033\\", envterm);
|
||||
/* tryning to reset the title of a backgrounded xterm like terminal */
|
||||
printf ("\33]0;%s\7", "Terminal");
|
||||
}
|
||||
else
|
||||
printf ("\033k%s\033\\", getenv ("TERM"));
|
||||
}
|
||||
else if (strcmp( getenv ("TERM"), "sun-cmd") == 0)
|
||||
printf ("\033]l%s\033\\", "Terminal");
|
||||
else if (strcmp( getenv ("TERM"), "hpterm") == 0)
|
||||
printf ("\033&f0k%dD%s", strlen("Terminal"), "Terminal");
|
||||
/* the following term supports the xterm excapes */
|
||||
else if (strncmp (getenv ("TERM"), "xterm", 5) == 0
|
||||
|| strncmp (getenv ("TERM"), "rxvt", 4) == 0
|
||||
|| strcmp( getenv ("TERM"), "aixterm") == 0
|
||||
|| strcmp( getenv ("TERM"), "iris-ansi") == 0
|
||||
|| strcmp( getenv ("TERM"), "dtterm") == 0)
|
||||
printf ("\33]0;%s\7", "Terminal");
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user