Patchwork base-files:fix the command line wrap around issue

login
register
mail settings
Submitter Zongchun Yu
Date May 21, 2013, 7:04 a.m.
Message ID <1369119875-4984-1-git-send-email-b40527@freescale.com>
Download mbox | patch
Permalink /patch/50201/
State Rejected, archived
Headers show

Comments

Zongchun Yu - May 21, 2013, 7:04 a.m.
From: Zongchun Yu <b40527@freescale.com>

when the character number of cmdline is more than 80. the following character should
go to a new line. rather than cover the prompt and the inputting character before.

Signed-off-by: Zongchun Yu <b40527@freescale.com>
---
 meta/recipes-core/base-files/base-files/profile |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
Ross Burton - May 21, 2013, 9:30 a.m.
On Tuesday, 21 May 2013, wrote:

> +export COLUMNS=2000
>

But there are not 2000 columns, you're just hard-coding a value that is
expected to dynamically change.

i.e, on my desktop in a gnome-terminal:

$ echo $COLUMNS
80

Then if I resize the window:

$ echo $COLUMNS
117

This is a bad workaround, can you explain the actual problem?  Are you not
seeing wrapping at a VT, in a terminal, or what?

Ross
Zongchun Yu - May 21, 2013, 11:20 a.m.
Hello Ross.

Thanks for your comments, I am sorry. the description is not clear.  please see the below content:

Sometimes we may use long commands. For example:

Normal display:

user@host:~cmd arg1 arg2 arg3 arg4 arg5…………argn-1 argn

|                                                                                                      |

1                                                                                                     80

Our board display:

argn@host:~cmd arg1 arg2 arg3 arg4 arg5…………argn-1

|                                                                                                      |

1                                                                                                     80

 

When the number of character is more than 80, the following character

will cover the character before. I.e “argn” cover “user”.

 

We tried to add "if [ -f /usr/bin/resize ]; then /usr/bin/resize > /dev/null; fi" to /etc/profile before.

But when we boot up the board and login using our test tool, we met some invalid characters.

So we give up the choice and only add “COLUMNS=2000” to /etc/profile.

 

I know it is a bad workaround, Do you have a good method to overcome the issue?

 

Best Regards

Zongchun

???: Burton, Ross [mailto:ross.burton@intel.com] 
????: 2013?5?21? 17:31
???: b40527@freescale.com; OE-core
??: Re: [OE-core] [PATCH] base-files:fix the command line wrap around issue

 

On Tuesday, 21 May 2013, wrote:

+export COLUMNS=2000

 

But there are not 2000 columns, you're just hard-coding a value that is expected to dynamically change.

 

i.e, on my desktop in a gnome-terminal:

 

$ echo $COLUMNS

80

 

Then if I resize the window:

 

$ echo $COLUMNS

117

 

This is a bad workaround, can you explain the actual problem?  Are you not seeing wrapping at a VT, in a terminal, or what?

 

Ross
Zongchun Yu - May 28, 2013, 2:51 a.m.
Hello Ross.

 

Do you have any other comments about this patch?

 

Thank you!

 

Best Regards

Zongchun
Otavio Salvador - May 28, 2013, 3:14 a.m.
On Mon, May 27, 2013 at 11:51 PM, Zongchun YU <b40527@freescale.com> wrote:

>   Hello Ross.****
>
> ** **
>
> Do you have any other comments about this patch?
>

It seems that setting it in environment is a workaround for the real issue.
Can't the same be accomplished changing busybox settings?
Zongchun Yu - May 28, 2013, 4:28 a.m.
It seems that setting it in environment is a workaround for the real issue.
Can't the same be accomplished changing busybox settings?

 

Can you explain your idea in detail? Do you mean changing the setting of
“resize” in busybox or other?

Thank you very much!

 

Best Regards

Zongchun

???: otavio.salvador@gmail.com [mailto:otavio.salvador@gmail.com] ??
Otavio Salvador
????: Tuesday, May 28, 2013 11:15 AM
???: Zongchun YU
??: Burton, Ross; OE-core
??: Re: [OE-core] [PATCH] base-files:fix the command line wrap around
issue

 

 

 

On Mon, May 27, 2013 at 11:51 PM, Zongchun YU <b40527@freescale.com> wrote:

Hello Ross.

 

Do you have any other comments about this patch?

 

It seems that setting it in environment is a workaround for the real issue.
Can't the same be accomplished changing busybox settings?
Ross Burton - May 29, 2013, 3:24 p.m.
On 28 May 2013 05:28, Zongchun YU <b40527@freescale.com> wrote:
> It seems that setting it in environment is a workaround for the real issue.
> Can't the same be accomplished changing busybox settings?
>
> Can you explain your idea in detail? Do you mean changing the setting of
> “resize” in busybox or other?

Yes.  At least for my target, CONFIG_RESIZE isn't enabled that I'd
expect to be required for this to work.

Ross
Zongchun Yu - May 30, 2013, 2:17 a.m.
Yes.  At least for my target, CONFIG_RESIZE isn't enabled that I'd expect to be required for this to work.

for my target, CONFIG_RESIZE have been enabled, if we use resize in profile, we may meet the invalid character issue as I mentioned earlier.
Otavio Salvador - May 30, 2013, 5:30 p.m.
On Wed, May 29, 2013 at 11:17 PM, Zongchun YU <b40527@freescale.com> wrote:

> Yes.  At least for my target, CONFIG_RESIZE isn't enabled that I'd expect
> to be required for this to work.
>
> for my target, CONFIG_RESIZE have been enabled, if we use resize in
> profile, we may meet the invalid character issue as I mentioned earlier.
>

I think we need to find the cause of the invalid character; your proposed
patch is a workaround and not a fix for the real issue.

Patch

diff --git a/meta/recipes-core/base-files/base-files/profile b/meta/recipes-core/base-files/base-files/profile
index 8eeaac3..f58ae3d 100644
--- a/meta/recipes-core/base-files/base-files/profile
+++ b/meta/recipes-core/base-files/base-files/profile
@@ -27,6 +27,7 @@  if [ -d /etc/profile.d ]; then
 fi
 
 export PATH PS1 OPIEDIR QPEDIR QTDIR EDITOR TERM
+export COLUMNS=2000
 
 umask 022