{"action":"opened","issue":{"url":"https://api.github.com/repos/Azure/azure-cli/issues/6537","repository_url":"https://api.github.com/repos/Azure/azure-cli","labels_url":"https://api.github.com/repos/Azure/azure-cli/issues/6537/labels{/name}","comments_url":"https://api.github.com/repos/Azure/azure-cli/issues/6537/comments","events_url":"https://api.github.com/repos/Azure/azure-cli/issues/6537/events","html_url":"https://github.com/Azure/azure-cli/issues/6537","id":330725930,"node_id":"MDU6SXNzdWUzMzA3MjU5MzA=","number":6537,"title":"az container exec: garbage characters inserted at shell prompt","user":{"login":"mmacy","id":13394541,"node_id":"MDQ6VXNlcjEzMzk0NTQx","avatar_url":"https://avatars1.githubusercontent.com/u/13394541?v=4","gravatar_id":"","url":"https://api.github.com/users/mmacy","html_url":"https://github.com/mmacy","followers_url":"https://api.github.com/users/mmacy/followers","following_url":"https://api.github.com/users/mmacy/following{/other_user}","gists_url":"https://api.github.com/users/mmacy/gists{/gist_id}","starred_url":"https://api.github.com/users/mmacy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmacy/subscriptions","organizations_url":"https://api.github.com/users/mmacy/orgs","repos_url":"https://api.github.com/users/mmacy/repos","events_url":"https://api.github.com/users/mmacy/events{/privacy}","received_events_url":"https://api.github.com/users/mmacy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-06-08T16:34:52Z","updated_at":"2018-06-08T16:34:52Z","closed_at":null,"author_association":"MEMBER","body":"**Describe the bug**\r\nWhen exec'ing a shell in an Alpine-based container running in Azure Container Instances, garbage characters are inserted on key press. In the example output below, the `ls` command is attempted, but `[6;5R` was inserted when the \"l\" key was pressed, and the command fails:\r\n```console\r\n$ az container exec -g rg604 -n alpine-test-02 --exec-command \"/bin/ash\"\r\n/ # [6;5Rls\r\n/bin/ash: [6: not found\r\n/bin/ash: 5Rls: not found\r\n/ # \r\n```\r\n\r\n**To Reproduce**\r\n1. Start Alpine container in ACI:\r\n   ```console\r\n   $ az container create -g rg604 -n alpine-test-02 --image alpine --command-line \"tail -f /dev/null\"\r\n   ```\r\n\r\n1. Use `az container exec` to spawn and attach to the `ash` shell in the container:\r\n   ```console\r\n   $ az container exec -g rg604 -n alpine-test-02 --exec-command \"/bin/ash\"\r\n   ```\r\n\r\n1. Once inside the container, execute the `ls` command to list directory contents:\r\n   ```console\r\n   $ az container exec -g rg604 -n alpine-test-02 --exec-command \"/bin/ash\"\r\n   / # [6;5Rls\r\n   /bin/ash: [6: not found\r\n   /bin/ash: 5Rls: not found\r\n   / # \r\n   ```\r\n   Note the characters `[6;5R` were inserted when the \"l\" key was pressed, causing the `ls` command to fail.\r\n\r\nThis above example output was from Bash on Ubuntu 18.04, but this behavior also occurs in the Cloud Shell:\r\n```console\r\nmarsh@Azure:~$ az container exec -g rg604 -n alpine-test-02 --exec-command \"/bin/ash\"\r\n/ # [10;5Rls\r\n/bin/ash: [10: not found\r\n/bin/ash: 5Rls: not found\r\n/ #\r\n```\r\n\r\n**Expected behavior**\r\nWhen exec'ed into a container instance, I should be able to enter commands in the terminal without \"garbage\" characters being inserted on keypress.\r\n\r\n**Environment summary**\r\n* Install Method : apt on Ubuntu, and the included `az` on Cloud Shell\r\n* CLI version: 2.0.34\r\n* OS: Ubuntu 18.04 and Cloud Shell\r\n* Shell: bash on Ubuntu and Cloud Shell\r\n\r\n**Additional context**\r\nExec'ing into a locally run Alpine container does not exhibit this behavior:\r\n\r\n```console\r\n$ docker run -d alpine tail -f /dev/null\r\nd375353c5f36d6d1bb799df9d9708d9c2e5ec1bfb39080085948d12c052f3665\r\n$ docker exec -it d375353c5f36 /bin/ash\r\n/ # ls\r\nbin    etc    lib    mnt    root   sbin   sys    usr\r\ndev    home   media  proc   run    srv    tmp    var\r\n/ # \r\n```\r\n"}}
{"actor":{"display_login":"mmacy"}}