aboutsummaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2024-04-09 08:58:58 +0100
committerRon Yorston <rmy@pobox.com>2024-04-09 08:58:58 +0100
commitfcf3ec2877f042c6957d808e562807089e23ebe6 (patch)
tree02fc4bf8d6fd8284564d3cf27cbd17482b8f5744 /win32
parent55ecf3a746db5131ca078875168a59feab8b26f1 (diff)
downloadbusybox-w32-fcf3ec2877f042c6957d808e562807089e23ebe6.tar.gz
busybox-w32-fcf3ec2877f042c6957d808e562807089e23ebe6.tar.bz2
busybox-w32-fcf3ec2877f042c6957d808e562807089e23ebe6.zip
ash: add title built-in
Implement a 'title' built-in for ash. It's very simple-minded, performs almost no error checking and is completely non-portable. - With no arguments it prints the current console title. - If arguments are provided the *first only* is set as the console title. Costs 88-116 bytes. (GitHub issue #401)
Diffstat (limited to 'win32')
-rw-r--r--win32/winansi.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/win32/winansi.c b/win32/winansi.c
index 0dd2e17f2..3b7744b39 100644
--- a/win32/winansi.c
+++ b/win32/winansi.c
@@ -179,8 +179,12 @@ int terminal_mode(int reset)
179 179
180void set_title(const char *str) 180void set_title(const char *str)
181{ 181{
182 if (is_console(STDOUT_FILENO)) 182 SetConsoleTitle(str);
183 SetConsoleTitle(str); 183}
184
185int get_title(char *buf, int len)
186{
187 return GetConsoleTitle(buf, len);
184} 188}
185 189
186static HANDLE dup_handle(HANDLE h) 190static HANDLE dup_handle(HANDLE h)