vercel / hyper

A terminal built on web technologies
https://hyper.is
MIT License
43.2k stars 3.51k forks source link

Hyper overrides first 15 system colors in bash on Mac Mojave #4821

Closed naomiquinones closed 3 years ago

naomiquinones commented 4 years ago

Hello, when I use Hyper to run shell commands that use TPUT color codes 0 through 15 or ANSI color codes 30 through 37 to output colored text, the colors display incorrectly. However, when I view the output in iTerm and the Terminal application, the colors display as expected. Something about Hyper interferes with the colors.

Having a magenta that looks like cyan is a problem because I'm relying on the color codes to remain consistent when I output the name of the colors in their colors so the user can choose from among the options.

Mixed up colors

rgb(104,201,207) cyan rgb(132,214,236) magenta rgb(239,156,64) yellow rgb(167,131,247) blue rgb(179,224,83) green rgb(203,58,104) red

I suspect it's the theme but I'm not sure.

Regardless, is there a way to fix the overriding of the shell environment's colors?

Compare first 15 colors in three terminal programs

  1. Here is the output of the colors in iTerm:

    Screen Shot 2020-08-18 at 12 45 44 AM
  2. Here is the output in the Mac Terminal app. The colors are very similar to those in iTerm:

    Screen Shot 2020-08-18 at 12 46 02 AM
  3. Here is the output in Hyper. The first 15 colors have been changed, with the first seven or eight seeming duplicated:

    Screen Shot 2020-08-18 at 12 46 33 AM

I'm using version Hyper 3.0.2 on a Mac running OS 10.14.6.

My .hyper.js file: module.exports = { config: { updateChannel: 'stable', fontSize: 12, fontFamily: 'Menlo, "DejaVu Sans Mono", Consolas, "Lucida Console", monospace', fontWeight: 'normal', fontWeightBold: 'bold', lineHeight: 1, letterSpacing: 0, cursorColor: 'rgb(248,28,229)', cursorAccentColor: '#000', cursorShape: 'BLOCK', cursorBlink: false, foregroundColor: '#fff', backgroundColor: '#000', selectionColor: 'rgba(248,28,229,0.3)', borderColor: '#333', css: '', termCSS: '', showHamburgerMenu: '', showWindowControls: '', padding: '12px 14px', colors: { black: '#000000', red: '#C51E14', green: '#1DC121', yellow: '#C7C329', blue: '#0A2FC4', magenta: '#C839C5', cyan: '#20C5C6', white: '#C7C7C7', lightBlack: '#686868', lightRed: '#FD6F6B', lightGreen: '#67F86F', lightYellow: '#FFFA72', lightBlue: '#6A76FB', lightMagenta: '#FD7CFC', lightCyan: '#68FDFE', lightWhite: '#FFFFFF', }, shell: '', shellArgs: ['--login'], env: {}, bell: 'SOUND', copyOnSelect: false, defaultSSHApp: true, quickEdit: false, macOptionSelectionMode: 'vertical', webGLRenderer: true, }, plugins: ['hyper-monokai-deluxe'], localPlugins: [], keymaps: { }, };

LabhanshAgrawal commented 3 years ago

You're using a theme which is changing the colors.

LabhanshAgrawal commented 3 years ago

you can use the latest build from ci and use osc 4 sequences to redefine the colors (the support for osc 4 was added very recently, it's not there in stable)