Patchwork base-files: set dynamic COLUMNS via resize command

login
register
mail settings
Submitter Ting Liu
Date July 29, 2014, 9:03 a.m.
Message ID <1406624623-25774-1-git-send-email-ting.liu@freescale.com>
Download mbox | patch
Permalink /patch/76829/
State New
Headers show

Comments

Ting Liu - July 29, 2014, 9:03 a.m.
From: Ting Liu <ting.liu@freescale.com>

By default, COLUMNS is set to 80. If possible, run 'resize' to
determine what the current dimensions are. This avoids the final
part of long lines overlap the start of the same line.

Signed-off-by: Ting Liu <ting.liu@freescale.com>
---
 meta/recipes-core/base-files/base-files/profile |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
Mark Hatle - July 29, 2014, 1:43 p.m.
On 7/29/14, 4:03 AM, ting.liu@freescale.com wrote:
> From: Ting Liu <ting.liu@freescale.com>
>
> By default, COLUMNS is set to 80. If possible, run 'resize' to
> determine what the current dimensions are. This avoids the final
> part of long lines overlap the start of the same line.
>
> Signed-off-by: Ting Liu <ting.liu@freescale.com>
> ---
>   meta/recipes-core/base-files/base-files/profile |    4 ++++
>   1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/meta/recipes-core/base-files/base-files/profile b/meta/recipes-core/base-files/base-files/profile
> index 0b2d9d7..88ab8d8 100644
> --- a/meta/recipes-core/base-files/base-files/profile
> +++ b/meta/recipes-core/base-files/base-files/profile
> @@ -26,6 +26,10 @@ if [ -d /etc/profile.d ]; then
>     unset i
>   fi
>
> +if [ -x /usr/bin/resize ];then
> +  /usr/bin/resize >/dev/null
> +fi
> +

Not sure how useful this is -- but -- the code should dynamically check for 
${bindir} instead of hard code /usr/bin here.  On many systems people collapse 
'bindir' down to just '/bin'.

So my suggestion would be an accompanying do_install step that corrects this 
reference if necessary.. something perhaps like:

if [ "/usr/bin" != "${bindir}" ]; then
     sed -i /usr/bin/resize -e "s,/usr/bin/resize,${bindir}/resize,"
fi

I'll leave it to others to discuss the merit of adding resize.  (I don't object 
BTW).

>   export PATH PS1 OPIEDIR QPEDIR QTDIR EDITOR TERM
>
>   umask 022
>
Khem Raj - July 30, 2014, 5:56 a.m.
On Tue, Jul 29, 2014 at 2:03 AM,  <ting.liu@freescale.com> wrote:
> By default, COLUMNS is set to 80. If possible, run 'resize' to
> determine what the current dimensions are. This avoids the final
> part of long lines overlap the start of the same line.
>

what apps are showing these issues ?
Ting Liu - July 30, 2014, 7:22 a.m.
> -----Original Message-----
> From: Khem Raj [mailto:raj.khem@gmail.com]
> Sent: Wednesday, July 30, 2014 1:57 PM
> To: Liu Ting-B28495
> Cc: Patches and discussions about the oe-core layer
> Subject: Re: [OE-core] [oe-core][PATCH] base-files: set dynamic COLUMNS via
> resize command
> 
> On Tue, Jul 29, 2014 at 2:03 AM,  <ting.liu@freescale.com> wrote:
> > By default, COLUMNS is set to 80. If possible, run 'resize' to
> > determine what the current dimensions are. This avoids the final part
> > of long lines overlap the start of the same line.
> >
> 
> what apps are showing these issues ?

Putty to login board via serial port.

Patch

diff --git a/meta/recipes-core/base-files/base-files/profile b/meta/recipes-core/base-files/base-files/profile
index 0b2d9d7..88ab8d8 100644
--- a/meta/recipes-core/base-files/base-files/profile
+++ b/meta/recipes-core/base-files/base-files/profile
@@ -26,6 +26,10 @@  if [ -d /etc/profile.d ]; then
   unset i
 fi
 
+if [ -x /usr/bin/resize ];then
+  /usr/bin/resize >/dev/null
+fi
+
 export PATH PS1 OPIEDIR QPEDIR QTDIR EDITOR TERM
 
 umask 022