micro-editor / micro-editor/micro

Bug: inverse highlighting doesn't display properly in terminals running inside micro

Open
#2,733 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
29.6k
Forks
1.4k
Avg merge
2d 18h
Merged PRs (30d)
10

Description

Description of the problem or steps to reproduce

Add this to your ~/.bashrc file to automagically display your current git branch name whenever you cd into a directory containing a git repo:
from my ~/.bash_aliases file here in my eRCaGuy_dotfiles repo:

gs_git_show_branch() {
    GIT_BRANCH="$(git symbolic-ref -q --short HEAD 2>/dev/null)"
    if [ -n "$GIT_BRANCH" ]; then
        echo "$GIT_BRANCH"
    fi
}
PS1="\e[7m\$(gs_git_show_branch)\e[m\n$PS1" # comment out to NOT show git branch!
PS1='\$SHLVL'":$SHLVL $PS1"                 # comment out to NOT show shell level!

This displays the shell level and the git branch name, if inside a git branch, like this:

image

Notice the highlighting of the master git branch name: white background, black foreground.

Well, if you open micro with micro and then use Ctrl+E then type in term bash inside micro, to open a bash terminal up inside micro, this is what that looks like:

image

It's broken. I expect to see the word master, as shown above, but I don't. I just see a greyed out box. If I copy/paste the content to an editor, I can see it does contain the word master, but it doesn't display properly inside micro obviously.

Specifications

Commit hash: 225927b
OS: Linux Ubuntu 22.04
Terminal: terminator 2.1.1

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.

Research direction

Reproduce the issue on Ubuntu by opening micro, pressing Ctrl-E, and running term bash with the provided PS1 configuration. Start by tracing the terminal rendering path used by this embedded shell and compare it with a normal terminal. Done means the inverse-highlighted master branch displays correctly inside micro without breaking the surrounding prompt.

Written by the indexing model from the issue text.

Assessment

Tech stack
bash, go, linux
Domain
cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.