()
| 961 | |
| 962 | // very simple adjustment of the command div font size so it doesn't overflow |
| 963 | function adjustcommandfontsize() { |
| 964 | const commandlength = Array.from( |
| 965 | document.querySelectorAll( |
| 966 | '#command span[class^=command], #command span[class^=shell]', |
| 967 | ), |
| 968 | ) |
| 969 | .reduce((acc, el) => acc + el.textContent, '') |
| 970 | .trim().length; |
| 971 | let commandfontsize; |
| 972 | |
| 973 | if (commandlength > 105) commandfontsize = '10px'; |
| 974 | else if (commandlength > 95) commandfontsize = '12px'; |
| 975 | else if (commandlength > 70) commandfontsize = '14px'; |
| 976 | else if (commandlength > 60) commandfontsize = '16px'; |
| 977 | |
| 978 | if (commandfontsize) { |
| 979 | log( |
| 980 | 'command length', |
| 981 | commandlength, |
| 982 | ', adjusting font size to', |
| 983 | commandfontsize, |
| 984 | ); |
| 985 | document.getElementById('command').style.fontSize = commandfontsize; |
| 986 | } |
| 987 | } |
| 988 | |
| 989 | let ignorekeydown = false; |
| 990 |
nothing calls this directly
no outgoing calls
no test coverage detected