<div dir="ltr">On 18 September 2017 at 16:07, Peter Kjellerstedt <span dir="ltr">&lt;<a href="mailto:peter.kjellerstedt@axis.com" target="_blank">peter.kjellerstedt@axis.com</a>&gt;</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">&gt; -----Original Message-----<br>
&gt; From: <a href="mailto:openembedded-core-bounces@lists.openembedded.org">openembedded-core-bounces@<wbr>lists.openembedded.org</a><br>
&gt; [mailto:<a href="mailto:openembedded-core-bounces@lists.openembedded.org">openembedded-core-<wbr>bounces@lists.openembedded.org</a><wbr>] On Behalf Of<br>
&gt; Mike Looijmans<br>
&gt; Sent: den 18 september 2017 16:07<br>
&gt; To: <a href="mailto:openembedded-core@lists.openembedded.org">openembedded-core@lists.<wbr>openembedded.org</a><br>
&gt; Cc: Mike Looijmans &lt;<a href="mailto:mike.looijmans@topic.nl">mike.looijmans@topic.nl</a>&gt;; Peter Kjellerstedt<br>
&gt; &lt;<a href="mailto:peter.kjellerstedt@axis.com">peter.kjellerstedt@axis.com</a>&gt;<br>
&gt; Subject: [OE-core] [PATCH] base-files: profile: Get rid of &quot;resize&quot;<br>
&gt;<br>
&gt; The &quot;resize&quot; command actually outputs shell commands to be executed, for<br>
&gt; example:<br>
&gt;<br>
&gt; $ resize<br>
&gt; COLUMNS=102;<br>
&gt; LINES=27;<br>
&gt; export COLUMNS LINES;<br>
&gt;<br>
&gt; The output of &quot;resize&quot; is being discarded to /dev/null so the call has no<br>
&gt; effect whatsoever, and does not change the environment (it cannot change the<br>
&gt; environment of its parent). Remove the call and hence solve the messages<br>
&gt; about shells missing &quot;command&quot; or &quot;tty&quot; or &quot;resize&quot;.<br>
&gt;<br>
&gt; Signed-off-by: Mike Looijmans &lt;<a href="mailto:mike.looijmans@topic.nl">mike.looijmans@topic.nl</a>&gt;<br>
&gt; ---<br>
&gt;  meta/recipes-core/base-files/<wbr>base-files/profile | 9 ---------<br>
&gt;  1 file changed, 9 deletions(-)<br>
&gt;<br>
&gt; diff --git a/meta/recipes-core/base-<wbr>files/base-files/profile b/meta/recipes-core/base-<wbr>files/base-files/profile<br>
&gt; index a062028..cfd0d69 100644<br>
&gt; --- a/meta/recipes-core/base-<wbr>files/base-files/profile<br>
&gt; +++ b/meta/recipes-core/base-<wbr>files/base-files/profile<br>
&gt; @@ -20,15 +20,6 @@ if [ -d /etc/profile.d ]; then<br>
&gt;       unset i<br>
&gt;  fi<br>
&gt;<br>
&gt; -if command -v resize &gt;/dev/null &amp;&amp; command -v tty &gt;/dev/null; then<br>
&gt; -     # Make sure we are on a serial console (i.e. the device used starts with<br>
&gt; -     # /dev/tty[A-z]), otherwise we confuse e.g. the eclipse launcher which<br>
&gt; -     # tries do use ssh<br>
&gt; -     case $(tty) in<br>
&gt; -             /dev/tty[A-z]*) resize &gt;/dev/null;;<br>
&gt; -     esac<br>
&gt; -fi<br>
&gt; -<br>
&gt;  export PATH PS1 OPIEDIR QPEDIR QTDIR EDITOR TERM<br>
&gt;<br>
&gt;  umask 022<br>
&gt; --<br>
&gt; 1.9.1<br>
<br>
</div></div>Hold on. Looking at busybox&#39; 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, &amp;w) where w contains the<br>
calculated sizes.<br></blockquote><div><br></div><div>My knowledge of ANSI escapes is incredibly sketchy, but isn&#39;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>