<div dir="ltr">On 18 September 2017 at 16:07, Peter Kjellerstedt <span dir="ltr"><<a href="mailto:peter.kjellerstedt@axis.com" target="_blank">peter.kjellerstedt@axis.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">> -----Original Message-----<br>
> From: <a href="mailto:openembedded-core-bounces@lists.openembedded.org">openembedded-core-bounces@<wbr>lists.openembedded.org</a><br>
> [mailto:<a href="mailto:openembedded-core-bounces@lists.openembedded.org">openembedded-core-<wbr>bounces@lists.openembedded.org</a><wbr>] On Behalf Of<br>
> Mike Looijmans<br>
> Sent: den 18 september 2017 16:07<br>
> To: <a href="mailto:openembedded-core@lists.openembedded.org">openembedded-core@lists.<wbr>openembedded.org</a><br>
> Cc: Mike Looijmans <<a href="mailto:mike.looijmans@topic.nl">mike.looijmans@topic.nl</a>>; Peter Kjellerstedt<br>
> <<a href="mailto:peter.kjellerstedt@axis.com">peter.kjellerstedt@axis.com</a>><br>
> Subject: [OE-core] [PATCH] base-files: profile: Get rid of "resize"<br>
><br>
> The "resize" command actually outputs shell commands to be executed, for<br>
> example:<br>
><br>
> $ resize<br>
> COLUMNS=102;<br>
> LINES=27;<br>
> export COLUMNS LINES;<br>
><br>
> The output of "resize" is being discarded to /dev/null so the call has no<br>
> effect whatsoever, and does not change the environment (it cannot change the<br>
> environment of its parent). Remove the call and hence solve the messages<br>
> about shells missing "command" or "tty" or "resize".<br>
><br>
> Signed-off-by: Mike Looijmans <<a href="mailto:mike.looijmans@topic.nl">mike.looijmans@topic.nl</a>><br>
> ---<br>
> meta/recipes-core/base-files/<wbr>base-files/profile | 9 ---------<br>
> 1 file changed, 9 deletions(-)<br>
><br>
> diff --git a/meta/recipes-core/base-<wbr>files/base-files/profile b/meta/recipes-core/base-<wbr>files/base-files/profile<br>
> index a062028..cfd0d69 100644<br>
> --- a/meta/recipes-core/base-<wbr>files/base-files/profile<br>
> +++ b/meta/recipes-core/base-<wbr>files/base-files/profile<br>
> @@ -20,15 +20,6 @@ if [ -d /etc/profile.d ]; then<br>
> unset i<br>
> fi<br>
><br>
> -if command -v resize >/dev/null && command -v tty >/dev/null; then<br>
> - # Make sure we are on a serial console (i.e. the device used starts with<br>
> - # /dev/tty[A-z]), otherwise we confuse e.g. the eclipse launcher which<br>
> - # tries do use ssh<br>
> - case $(tty) in<br>
> - /dev/tty[A-z]*) resize >/dev/null;;<br>
> - esac<br>
> -fi<br>
> -<br>
> export PATH PS1 OPIEDIR QPEDIR QTDIR EDITOR TERM<br>
><br>
> umask 022<br>
> --<br>
> 1.9.1<br>
<br>
</div></div>Hold on. Looking at busybox' source code for resize, it seems that<br>
it actually does something besides outputting the shell code to<br>
set the variables (which is actually enabled by a separate feature<br>
called ENABLE_FEATURE_RESIZE_PRINT). It also calls<br>
ioctl(STDERR_FILENO, TIOCSWINSZ, &w) where w contains the<br>
calculated sizes.<br></blockquote><div><br></div><div>My knowledge of ANSI escapes is incredibly sketchy, but isn't that the code to *get* the size of the screen? Put the cursor at 999,999, then ask where it is?</div><div><br></div><div>Ross </div></div></div></div>