siemens / meta-iot2050

SIMATIC IOT2050 Isar/Debian Board Support Package
MIT License
129 stars 76 forks source link

customizations-example: Resizing a terminal #381

Closed AsuraZeng closed 1 year ago

AsuraZeng commented 1 year ago

Console window has fixed columns and rows, there is no method to pass the window columns and rows to console terminal. So it can not adjust the window size automatically.

This change would make adjust the console terminal column and row according to the actual terminal window size.

The most important benefit is that we can see the whole output when using journalctl systemctl and so on to output the debug info if the debug information is too long.

Autosize-console origin from iot2050setup tool.

Signed-off-by: chao zeng chao.zeng@siemens.com

jan-kiszka commented 1 year ago

I'm not sure if we want to run this unconditionally, also for consoles not needing this (ssh sessions eg.).

Further findings:

AsuraZeng commented 1 year ago

yes, this is only true for serial terminal not for the ssh session. in the script, limit to apply this change for the tty console.

you mean the resize? it seems could set to the fixed column and rows, anyway we need to get the current terminal window size. Why I use python script because in the iot2050setup tool has already contains this logic, just re-use that part.

I think this is good for our usage. And if this is not good to add to the auto process flow, maybe at first stage, just install this tool maybe helpful.

AsuraZeng commented 1 year ago

@jan-kiszka Regarding terminal resize has already re-wrote.