fix incorrect DCS command handling

http-comm
Ondřej Hruška 7 years ago
parent 7ffc947f1a
commit 55afcca955
Signed by: MightyPork
GPG Key ID: 2C5FD5035250423D
  1. 2
      Makefile
  2. 2
      libesphttpd
  3. 6
      user/apars_dcs.c
  4. 2
      user/apars_short.c
  5. 12
      user/screen.c
  6. 2
      user/screen.h

@ -54,7 +54,7 @@ APPGEN ?= $(SDK_BASE)/tools/gen_appbin.py
TARGET = httpd
# which modules (subdirectories) of the project to include in compiling
MODULES = user esphttpclient
MODULES = user
EXTRA_INCDIR = include libesphttpd/include
# libraries used in this project, mainly provided by the SDK

@ -1 +1 @@
Subproject commit c8dda50970d4c7c7ed2b9db4df7d433a39dde5b8
Subproject commit 7fce9474395e208c83325ff6150fdd21ba16c9a4

@ -47,7 +47,9 @@ apars_handle_dcs(const char *buffer)
}
else if (buffer[2] == 'r') {
// DECSTBM - Query scrolling region
sprintf(buf, "\033P1$r%d;%dr\033\\", 1, termconf_live.height); // 1-80 TODO real extent of scrolling region
int v0, v1;
screen_region_get(&v0, &v1);
sprintf(buf, "\033P1$r%d;%dr\033\\", v0+1, v1+1);
apars_respond(buf);
}
else if (buffer[2] == 's') {
@ -64,7 +66,7 @@ apars_handle_dcs(const char *buffer)
}
else if (strneq(buffer+2, " q", 2)) {
// DECSCUSR - Query cursor style
sprintf(buf, "\033P1$r%d q\033\\", 1);
sprintf(buf, "\033P1$r%d q\033\\", termconf_live.cursor_shape);
/*
Ps = 0 -> blinking block.
Ps = 1 -> blinking block (default).

@ -106,7 +106,7 @@ void ICACHE_FLASH_ATTR apars_handle_hash_cmd(char c)
// development codes - do not use!
case '7':
http_get("http://example.com", NULL);
http_get("http://wtfismyip.com/text", NULL, http_callback_example);
break;
default:

@ -1152,6 +1152,14 @@ screen_cursor_get(int *y, int *x)
}
}
/* Report scrolling region */
void ICACHE_FLASH_ATTR
screen_region_get(int *pv0, int *pv1)
{
*pv0 = TOP;
*pv1 = BTM;
}
/**
* Set cursor X position
*/
@ -1979,13 +1987,9 @@ screenSerializeToBuffer(char *buffer, size_t buf_len, ScreenNotifyTopics topics,
bufput_utf8(termconf_live.default_fg & 0xFFFF);
bufput_utf8((termconf_live.default_fg >> 16) & 0xFFFF);
dbg("Fg %04X,%04X", termconf_live.default_fg & 0xFFFF, (termconf_live.default_fg >> 16) & 0xFFFF);
bufput_utf8(termconf_live.default_bg & 0xFFFF);
bufput_utf8((termconf_live.default_bg >> 16) & 0xFFFF);
dbg("Bg %04X,%04X", termconf_live.default_bg & 0xFFFF, (termconf_live.default_bg >> 16) & 0xFFFF);
bufput_utf8(
(scr.cursor_visible << 0) |
(termconf_live.debugbar << 1) | // debugbar - this was previously "hanging"

@ -249,6 +249,8 @@ void screen_wrap_enable(bool enable);
void screen_reverse_wrap_enable(bool enable);
/** Set scrolling region */
void screen_set_scrolling_region(int from, int to);
/* Report scrolling region */
void screen_region_get(int *pv0, int *pv1);
/** Enable or disable origin remap to top left of scrolling region */
void screen_set_origin_mode(bool region_origin);

Loading…
Cancel
Save