Bug 13581 - Line wrapping over prompt in BASH
Summary: Line wrapping over prompt in BASH
Status: RESOLVED FIXED
Alias: None
Product: General Runtime
Classification: Runtime
Component: General Runtime (show other bugs)
Version: 2.7.2
Hardware: x86 Multiple
: Medium+ normal
Target Milestone: 3.2 M4
Assignee: Jason Wessel
QA Contact:
URL:
Whiteboard: BACKPORT
Depends on:
Blocks:
 
Reported: 2019-10-07 12:37 UTC by phodina
Modified: 2020-11-19 16:13 UTC (History)
4 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Don't know


Attachments
Line wrapping over prompt in BASH (14.32 KB, image/png)
2019-10-07 12:37 UTC, phodina
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description phodina 2019-10-07 12:37:51 UTC
Created attachment 4576 [details]
Line wrapping over prompt in BASH

I'm reporting a bug in `bash` shell. The issue is line wrapping over the `$PS1` prompt when I type more than 80 characters. Also resizing the terminal window doesn't update the shell size.

The issue is present on `arm64` arch, but I replicaed it also in `qemux86`. 

It happens when I connect over serial as well as ssh.

I'm using:

- poky warrior: 38d5c8ea98cfa49825c473eba8984c12edf062be
- meta-openembedded warrior: 3bdbf72e3a4bf18a4a2c7afbde4f7ab773aeded9 

The target is `apollo-image` using bitbake.

build/conf/local.conf:
```
MACHINE ?= "qemux86"
DISTRO ?= "apollo-poky"
```
build/conf/bblayers.conf:
```
# POKY_BBLAYERS_CONF_VERSION is increased each time build/conf/bblayers.conf
# changes incompatibly
POKY_BBLAYERS_CONF_VERSION = "2"

BBPATH = "${TOPDIR}"
BBFILES ?= ""

LAYERS = "/workdir"

BBLAYERS ?= " \
  ${LAYERS}/poky/meta \
  ${LAYERS}/poky/meta-poky \
  ${LAYERS}/poky/meta-yocto-bsp \
  ${LAYERS}/meta-openembedded/meta-oe \
  ${LAYERS}/meta-openembedded/meta-networking \
  ${LAYERS}/meta-openembedded/meta-python \
  ${LAYERS}/meta-openembedded/meta-perl \
  ${LAYERS}/meta-apollo \
"

SSTATE_DIR ?= "/shared/sstate/"
DL_DIR ?= "/shared/downloads"

SSTATE_MIRRORS = "file://.* file:///shared/sstate/PATH"
```
I'm using another layer called `meta-apollo`.
meta-apollo/conf/distro/apollo-poky.conf:
```
require conf/distro/poky.conf

VIRTUAL-RUNTIME_base-utils = "bash"
PREFERRED_PROVIDER_virtual/base-utils="bash"
PREFERRED_PROVIDER_base-utils="bash"
```
meta-apollo/recipes-core/images/apollo-image.bb:
```
IMAGE_INSTALL_append = " \
    busybox \
    bash \
    xterm \
    kernel-modules \
"
```

There is also attachment bash_prompt.png of the `bash` running in qemu for `x86`. The first input is before resizing the terminal window and the issue is not present. However, second input is after resizing the terminal window and you can see characters `3123` overwriting the prompt. 

Interesting fact is that running `busybox` does not reproduce the issue.

I checked the `$PS1` var as possible cause but even a simple const string without special sequence is affected.

Also calling manually the `resize` script from the package xterm to resize the terminal window does not help.