Do not use terminal control codes on `kup` output when it's not a terminal

Open
#120 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
cli

Research direction

Start by locating the kup list output and its terminal-detection logic, then reproduce the issue with kup list | tee z and inspect the captured output. Done means piped or redirected output contains no terminal control codes, while interactive terminal output retains its formatting.

Written by the indexing model from the issue text.

Description

c$ kup list | tee z
warning: error: unable to download 'https://api.github.com/repos/runtimeverification/k/commits/HEAD': HTTP error 403

       response body:

       {"message":"API rate limit exceeded for 122.249.238.158. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)","documentation_url":"https://docs.github.com/rest/overview/resources-in-the-rest-api#rate-limiting"}; using cached version
warning: error: unable to download 'https://api.github.com/repos/runtimeverification/kup/commits/HEAD': HTTP error 403

       response body:

       {"message":"API rate limit exceeded for 122.249.238.158. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)","documentation_url":"https://docs.github.com/rest/overview/resources-in-the-rest-api#rate-limiting"}; using cached version
┌──────────────────────┬────────────────────────────────────────────────────────────────────────────────────────────────────────────────┬────────────────────────────┐
│ Package name (alias) │ Installed version                                                                                              │ Status                     │
├──────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────┼────────────────────────────┤
│ k                    │ f73063d8260ca1a40c9e850db60f3a9a1dcb691f?narHash=sha256-pFOw/vJ6g9bM8PzfiaZtSc89Vohmcu/rCkxZiQAeAEo%3D         │ 🟠 newer version available │
│ kup                  │ ee27b243e7944099d1868b8ccb21d2a74b016e30?narHash=sha256-BKmc7jyM6xJ%2BfcCKO7X%2Bw57s5n%2B3fpC6%2BK//NtcmqDw%3D │ 🟢 installed               │
│ kavm                 │                                                                                                                │ 🔵 available               │
│ kevm                 │                                                                                                                │ 🔵 available               │
│ kplutus              │                                                                                                                │ 🔵 available               │
│ kmir                 │                                                                                                                │ 🔵 available               │
│ kontrol              │                                                                                                                │ 🔵 available               │
│ kmxwasm              │                                                                                                                │ 🔵 available               │
└──────────────────────┴────────────────────────────────────────────────────────────────────────────────────────────────────────────────┴────────────────────────────┘
c$ cat -v z
^[(0lqqqqqqqqqqqqqqqqqqqqqqwqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwqqqqqqqqqqqqqqqqqqqqqqqqqqqqk^[(B
^[(0x^[(B Package name (alias) ^[(0x^[(B Installed version                                                                                              ^[(0x^[(B Status                     ^[(0x^[(B
^[(0tqqqqqqqqqqqqqqqqqqqqqqnqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqnqqqqqqqqqqqqqqqqqqqqqqqqqqqqu^[(B
^[(0x^[(B k                    ^[(0x^[(B f73063d8260ca1a40c9e850db60f3a9a1dcb691f?narHash=sha256-pFOw/vJ6g9bM8PzfiaZtSc89Vohmcu/rCkxZiQAeAEo%3D         ^[(0x^[(B M-pM-^_M-^_M-  ^[[93mnewer version available^[[0m ^[(0x^[(B
^[(0x^[(B kup                  ^[(0x^[(B ee27b243e7944099d1868b8ccb21d2a74b016e30?narHash=sha256-BKmc7jyM6xJ%2BfcCKO7X%2Bw57s5n%2B3fpC6%2BK//NtcmqDw%3D ^[(0x^[(B M-pM-^_M-^_M-" ^[[92minstalled^[[0m               ^[(0x^[(B
^[(0x^[(B kavm                 ^[(0x^[(B                                                                                                                ^[(0x^[(B M-pM-^_M-^TM-5 ^[[94mavailable^[[0m               ^[(0x^[(B
^[(0x^[(B kevm                 ^[(0x^[(B                                                                                                                ^[(0x^[(B M-pM-^_M-^TM-5 ^[[94mavailable^[[0m               ^[(0x^[(B
^[(0x^[(B kplutus              ^[(0x^[(B                                                                                                                ^[(0x^[(B M-pM-^_M-^TM-5 ^[[94mavailable^[[0m               ^[(0x^[(B
^[(0x^[(B kmir                 ^[(0x^[(B                                                                                                                ^[(0x^[(B M-pM-^_M-^TM-5 ^[[94mavailable^[[0m               ^[(0x^[(B
^[(0x^[(B kontrol              ^[(0x^[(B                                                                                                                ^[(0x^[(B M-pM-^_M-^TM-5 ^[[94mavailable^[[0m               ^[(0x^[(B
^[(0x^[(B kmxwasm              ^[(0x^[(B                                                                                                                ^[(0x^[(B M-pM-^_M-^TM-5 ^[[94mavailable^[[0m               ^[(0x^[(B
^[(0mqqqqqqqqqqqqqqqqqqqqqqvqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqvqqqqqqqqqqqqqqqqqqqqqqqqqqqqj^[(B
c$ 

The cat -v output gives a pretty good sense of what this looks like in my editor, as well.

Dominant language
Python
Stars
10
Forks
2
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from runtimeverification/kup

All issues in runtimeverification/kup

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.