Skip to content

Commit

Permalink
Release v1.3.1. Rework tglutil_set_window_title.
Browse files Browse the repository at this point in the history
  • Loading branch information
wojciech-graj committed Jul 18, 2023
1 parent 3dcbdb6 commit 0e46432
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
5 changes: 0 additions & 5 deletions termgl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1212,14 +1212,9 @@ int tglutil_set_console_size(const unsigned col, const unsigned row)

int tglutil_set_window_title(const char *title)
{
/* Allegedly Windows supports the \033]2;Pt\033\\ OSC sequence, but it does not work. */
#ifdef __unix__
CALL_STDOUT(fputs("\033]2;", stdout), -1);
CALL_STDOUT(fputs(title, stdout), -1);
CALL_STDOUT(fputs("\033\\", stdout), -1);
#else /* defined(TGL_OS_WINDOWS) */
WINDOWS_CALL(!SetConsoleTitle(title), -1);
#endif
return 0;
}

Expand Down
4 changes: 1 addition & 3 deletions termgl.h
Original file line number Diff line number Diff line change
Expand Up @@ -331,9 +331,7 @@ int tglutil_set_console_size(unsigned col, unsigned row);
/**
* Attempts to set window title
* @return 0 on lack of errors, -1 on failure
* On failure, errno is set to value specified by:
* UNIX: https://man7.org/linux/man-pages/man3/fputc.3p.html#ERRORS
* Windows: https://docs.microsoft.com/en-us/windows/win32/debug/system-error-codes
* On failure, errno is set to value specified by: https://man7.org/linux/man-pages/man3/fputc.3p.html#ERRORS
*/
int tglutil_set_window_title(const char *title);

Expand Down

0 comments on commit 0e46432

Please sign in to comment.