Skip to content

Commit

Permalink
Add console command history (#7483, #8015)
Browse files Browse the repository at this point in the history
Add console command history (#7483, #8015)
  • Loading branch information
arendst committed Mar 29, 2020
1 parent 397fea3 commit 257dd18
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions RELEASENOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,4 @@ The following binary downloads have been compiled with ESP8266/Arduino library c
- Add support for unreachable (unplugged) Zigbee devices in Philips Hue emulation and Alexa
- Add support for 64x48 SSD1306 OLED (#6740)
- Add support for up to four MQTT GroupTopics using the same optional Device Group names (#8014)
- Add console command history (#7483, #8015)
1 change: 1 addition & 0 deletions tasmota/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
### 8.2.0.2 20200328

- Add support for up to four MQTT GroupTopics using the same optional Device Group names (#8014)
- Add console command history (#7483, #8015)

### 8.2.0.1 20200321

Expand Down
4 changes: 2 additions & 2 deletions tasmota/xdrv_01_webserver.ino
Original file line number Diff line number Diff line change
Expand Up @@ -213,12 +213,12 @@ const char HTTP_SCRIPT_CONSOL[] PROGMEM =
"}"

// Console command history - part 2
"var mh=20,hc=[],cn=0;"
"var hc=[],cn=0;" // hc = History commands, cn = Number of history being shown
"function cH(a){"
"var b=qs('#c1'),c=a.keyCode;" // c1 = Console command id
"38==c?(++cn>hc.length&&(cn=hc.length),b.value=hc[cn-1]||''):" // Arrow Up
"40==c?(0>--cn&&(cn=0),b.value=hc[cn-1]||''):" // Arrow Down
"13==c&&(hc.length>19&&hc.pop(),hc.unshift(b.value),cn=0)" // Enter
"13==c&&(hc.length>19&&hc.pop(),hc.unshift(b.value),cn=0)" // Enter, 19 = Max number -1 of commands in history
"}"

"wl(l);";
Expand Down

0 comments on commit 257dd18

Please sign in to comment.