summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nyancat.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/nyancat.c b/src/nyancat.c
index cb71217..70348e2 100644
--- a/src/nyancat.c
+++ b/src/nyancat.c
@@ -121,7 +121,7 @@ int digits(int val) {
* (^C) so that we can restore the cursor.
*/
void SIGINT_handler(int sig){
- printf("\033[?25h\033[0m");
+ printf("\\033[?25h\033[0m");
exit(0);
}
@@ -366,18 +366,19 @@ int main(int argc, char ** argv) {
char * nterm = getenv("TERM");
strcpy(term, nterm);
- /* Also get the number of columns, but not above 80 */
+ /* Also get the number of columns */
struct winsize w;
ioctl(0, TIOCGWINSZ, &w);
terminal_width = w.ws_col;
-
- if(terminal_width > 80) terminal_width = 80;
}
/* Convert the entire terminal string to lower case */
for (k = 0; k < strlen(term); ++k) {
term[k] = tolower(term[k]);
}
+
+ /* We don't want terminals wider than 80 columns */
+ if(terminal_width > 80) terminal_width = 80;
/* Do our terminal detection */
if (strstr(term, "xterm")) {
'#n137'>137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190