1
0
mirror of https://github.com/Tha14/toxic.git synced 2024-12-23 11:03:25 +01:00

stderr redirect doesn't work as intended, add invalid command message when no sound

This commit is contained in:
Jfreegman 2014-08-03 01:31:33 -04:00
parent 53663a7832
commit 3fc7c90630
No known key found for this signature in database
GPG Key ID: 3627F3144076AE63
4 changed files with 7 additions and 11 deletions

View File

@ -168,7 +168,9 @@ void execute(WINDOW *w, ToxWindow *self, Tox *m, const char *input, int mode)
if (do_command(w, self, m, num_args, GLOBAL_NUM_COMMANDS, global_commands, args) == 0)
return;
/* Just play sound instead */
/*line_info_add(self, NULL, NULL, NULL, "Invalid command.", SYS_MSG, 0, 0);*/
sound_notify(self, error, 0, NULL);
#ifdef _SOUND_NOTIFY
sound_notify(self, error, 0, NULL);
#else
line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Invalid command.");
#endif
}

View File

@ -41,8 +41,6 @@
#define PACKAGE_DATADIR "."
#endif
#define NO_SOUND "silent"
const struct _ui_strings {
const char* self;
const char* timestamps;

View File

@ -23,6 +23,8 @@
#ifndef _settings_h
#define _settings_h
#define NO_SOUND "silent"
/* holds user setting values */
struct user_settings {
int autolog; /* boolean */

View File

@ -705,12 +705,6 @@ int main(int argc, char *argv[])
useconds_t msleepval = 40000;
uint64_t loopcount = 0;
/* Redirect stdout to /dev/null
* NOTE: Might not be best solution
*/
freopen("/dev/null", "w", stderr);
while (true) {
update_unix_time();
do_toxic(m, prompt);