Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

basic image shell line-wrapping / command-recall unusable #550

Open
carlaarchuletatheone opened this issue Feb 20, 2025 · 2 comments
Open

Comments

@carlaarchuletatheone
Copy link

Discussed in #456

Originally posted by cevich April 1, 2024
I'm not able to use Docker, so my container engine is podman (v4.9.3). I'm using a very basic devcontainer through the CLI. The up and exec commands seem to work fine, and I'm able to run specific commands in my devcontainer without any problems.

{
    "name": "basic",
    "image": "mcr.microsoft.com/vscode/devcontainers/base:debian-12",
    "features": {
    },
    "securityOpt": [
        "label=disable",
        "apparmor=unconfined"
    ],
    "runArgs": [
        "--userns=keep-id"
    ]
}

The issue is, if I exec the bash (or zsh) command, the terminal prompt's line-wrapping and command-recall functions misbehave and render the console unusable.

I'm able to reproduce the problem with the mcr.microsoft.com/vscode/devcontainers/base:ubuntu-22.04 image as well. I've tried within the GNOME Terminal app as well as directly on a Linux console (i.e. ctrl-alt-F3). I'm even able to reproduce directly using the image:

podman run -it --rm mcr.microsoft.com/vscode/devcontainers/base:debian-12 bash
root ➜ / $ cd /usr/local/bin
he next linelocal/bin $ # this is a really long command that should wrap to t 

As you can see, it's wrapping ONTO the current terminal line, not a new one. If I press the up-arrow (command-recall) I get a similar effect. After a series of badly wrapped lines, this "off-by-one line" problem seems to stack, jumping the cursor up an extra line each time, rendering the terminal unusable.

Has anyone else experienced this behavior and/or know of a way to fix it?

Note: Inside the devcontainer or when directly running the base image, the system is aware of the terminal size, including when I change it:

root ➜ /usr/local/bin $ tput cols
79
root ➜ /usr/local/bin $ tput cols
80
root ➜ /usr/local/bin $ echo $COLUMNS
80
e next line/local/bin $ # this is a really long command that should wrap to the
```</div>
@carlaarchuletatheone
Copy link
Author

root ➜ /usr/local/bin $ tput cols
79
root ➜ /usr/local/bin $ tput cols
80
root ➜ /usr/local/bin $ echo $COLUMNS
80
e next line/local/bin $ # this is a really long command that should wrap to the

@haticecan37
Copy link

#456'da tartışıldı

Başlangıçta cevich tarafından 1 Nisan 2024'te yayınlandı Docker kullanamıyorum, bu yüzden konteyner motorum podman ( v4.9.3). CLI üzerinden çok basit bir devcontainer kullanıyorum. upve execkomutları gayet iyi çalışıyor gibi görünüyor ve devcontainer'ımda belirli komutları herhangi bir sorun yaşamadan çalıştırabiliyorum.

{
"name": "basic",
"image": "mcr.microsoft.com/vscode/devcontainers/base:debian-12",
"features": {
},
"securityOpt": [
"label=disable",
"apparmor=unconfined"
],
"runArgs": [
"--userns=keep-id"
]
}
Sorun şu ki , (veya ) execkomutunu verdiğimde , terminal isteminin satır kaydırma ve komut çağırma işlevleri hatalı davranıyor ve konsolu kullanılamaz hale getiriyor.bash``zsh

Sorunu görüntüyle de yeniden üretebiliyorum mcr.microsoft.com/vscode/devcontainers/base:ubuntu-22.04. GNOME Terminal uygulamasında ve doğrudan bir Linux konsolunda (yani ctrl-alt-F3) denedim. Görüntüyü kullanarak doğrudan yeniden üretebiliyorum bile:

```#550

podman run -it --rm mcr.microsoft.com/vscode/devcontainers/base:debian-12 bash
root ➜ / $ cd /usr/local/bin
he next linelocal/bin $ # this is a really long command that should wrap to t


Gördüğünüz gibi, yeni bir satıra değil, geçerli terminal satırına sarılıyor. Yukarı ok tuşuna (komut-geri çağırma) basarsam benzer bir etki elde ediyorum. Bir dizi kötü sarılmış satırdan sonra, bu "bir satır ötede" sorunu yığılıyor, imleci her seferinde fazladan bir satır yukarı atlatıyor ve terminali kullanılamaz hale getiriyor.

Bu davranışı başka biri deneyimledi mi ve/veya düzeltmenin bir yolunu biliyor mu?

Not: Devcontainer'ın içinde veya doğrudan temel imajı çalıştırırken, sistem terminal boyutunun farkındadır, ben değiştirdiğimde bile:

root ➜ /usr/local/bin $ tput cols
79
root ➜ /usr/local/bin $ tput cols
80
root ➜ /usr/local/bin $ echo $COLUMNS
80
e next line/local/bin $ # this is a really long command that should wrap to the

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants