Hyper: focus lost on tab switch

Created on 19 Dec 2016  ·  22Comments  ·  Source: vercel/hyper

  • [x] I am on the latest Hyper.app version
  • [x] I have searched the issues of this repo and believe that this is not a duplicate

Using hyper 1.0.0 on macOS 10.2.2.

After switching to hyper 1 I've noticed that after switching tabs (shift cmd left/right) the active tab sometimes either looses focus or never gets it. It happens a few times a day and I obviously can't rule out that I accidentally hit the touchpad, but it happens much more frequently than in previous versions (if at all).

Bug

Most helpful comment

It is really fixed ! You rock ! ❤️
Not an obvious solution ! Well done !

All 22 comments

For me, the terminal always loses focus when switching tabs with Cmd+Alt+Left/Right.

I hadn't come across Cmd+Shift+Left/Right before, but that shortcut seems to only work for me if the tab bar is already focused, not if the terminal is focused.

Huh, just restarted Hyper and both shortcuts work consistently now… so I guess we could say this is an intermittent problem!

I'm experiencing this problem almost all the times, restarting the application doesn't fix.

It's fairly reproducible here. If I open a new tab and go back to the previous one while it's still loading my shell, it'll lose focus.

Same issue, first time installer on node 7.3. Lost focus as soon as a new tab is created.

It seems to set the focus to the body element. If you press the tab key twice or click on it, it restores the focus to the window/iframe.

Same issue:

  • Open a new tab
  • Navigate left or right
  • Focus Lost
  • Press tab key twice and focus is back
  • Navigate left or right is ok now

This is 100% reproducible for me when opening a _new_ tab with Ctrl-T:

  1. Have a tab open
  2. Open another one via Ctrl-T
  3. Go back to the initial tab

The cursor blinks once but typing doesn’t work. You need to click into the content area to make the command line focused again and be able to start typing.

Just fixed this – I'd like to receive a confirmation from everyone of you just in case. Please test the latest master :v:

It is really fixed ! You rock ! ❤️
Not an obvious solution ! Well done !

Thanks a lot @matheuss for fixing this papercut! :ok_hand: :relaxed:

Can confirm it being fixed.

:-( I just noticed this happening on Windows for Hyper version 1.3.2 if I click to a different tab. I have to click in the console area before the cursor is active and the console accepts input.

I'm getting this with 1.3.3 too

@wesbos Are you on Windows? I can't reproduce it on MacOS

I'm getting this problem intermittently on 1.3.3 on macOS Sierra too. I have the following plugins:

{
  // ...

  plugins: [
    'hyper-no-close',
    'hypercwd',
    'hyperlinks',
    'hyperterm-atom-dark',
  ],
}

I'm on OSX

@wesbos and @karlhorky: You can reproduce it without any plugin ?

I think it's the Hyperlinks plugin - I only had two plugins and disabling hyperlinks fixes it.

I'm also experiencing this issue intermittently on Hyper v1.3.3 on Ubuntu GNOME v17.04. This is only an issue when changing tabs (ctrl-tab) but not when opening a new tab. If I enter a character, I can see the input go to another tab. e.g., if I have tabs A and B and switch from A to B then type ls<enter>, tab B is unchanged and does not have a cursor while tab A has a directory listing. The only plugin I have enabled is hyper-one-light.

Yeah, I'm not sure this has to do with a plugin. I can reproduce it with all plugins disabled.

It happens like @niedzielski describes - intermittently and when changing tabs via keyboard shortcuts (for me, with cmd-alt-⬅️ or cmd-alt-➡️).

Probably unrelated, but I can also cause focus to be lost by reloading a tab with cmd-R.

My .hyper.js:

// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.

module.exports = {
  config: {
    // default font size in pixels for all tabs
    fontSize: 12,

    // font family with optional fallbacks
    fontFamily: 'Menlo, "DejaVu Sans Mono", Consolas, "Lucida Console", monospace',

    // terminal cursor background color and opacity (hex, rgb, hsl, hsv, hwb or cmyk)
    cursorColor: 'rgba(248,28,229,0.8)',

    // `BEAM` for |, `UNDERLINE` for _, `BLOCK` for █
    cursorShape: 'BLOCK',

    // set to true for blinking cursor
    cursorBlink: false,

    // color of the text
    foregroundColor: '#fff',

    // terminal background color
    backgroundColor: '#000',

    // border color (window, tabs)
    borderColor: '#333',

    // custom css to embed in the main window
    css: '',

    // custom css to embed in the terminal window
    termCSS: '',

    // set to `true` (without backticks) if you're using a Linux setup that doesn't show native menus
    // default: `false` on Linux, `true` on Windows (ignored on macOS)
    showHamburgerMenu: '',

    // set to `false` if you want to hide the minimize, maximize and close buttons
    // additionally, set to `'left'` if you want them on the left, like in Ubuntu
    // default: `true` on windows and Linux (ignored on macOS)
    showWindowControls: '',

    // custom padding (css format, i.e.: `top right bottom left`)
    padding: '12px 14px',

    // the full list. if you're going to provide the full color palette,
    // including the 6 x 6 color cubes and the grayscale map, just provide
    // an array here instead of a color map object
    colors: {
      black: '#000000',
      red: '#ff0000',
      green: '#33ff00',
      yellow: '#ffff00',
      blue: '#0066ff',
      magenta: '#cc00ff',
      cyan: '#00ffff',
      white: '#d0d0d0',
      lightBlack: '#808080',
      lightRed: '#ff0000',
      lightGreen: '#33ff00',
      lightYellow: '#ffff00',
      lightBlue: '#0066ff',
      lightMagenta: '#cc00ff',
      lightCyan: '#00ffff',
      lightWhite: '#ffffff'
    },

    // the shell to run when spawning a new session (i.e. /usr/local/bin/fish)
    // if left empty, your system's login shell will be used by default
    // make sure to use a full path if the binary name doesn't work
    // (e.g `C:\\Windows\\System32\\bash.exe` instead of just `bash.exe`)
    // if you're using powershell, make sure to remove the `--login` below
    shell: '',

    // for setting shell arguments (i.e. for using interactive shellArgs: ['-i'])
    // by default ['--login'] will be used
    shellArgs: ['--login'],

    // for environment variables
    env: {},

    // set to false for no bell
    bell: 'SOUND',

    // if true, selected text will automatically be copied to the clipboard
    copyOnSelect: false

    // if true, on right click selected text will be copied or pasted if no
    // selection is present (true by default on Windows)
    // quickEdit: true

    // URL to custom bell
    // bellSoundURL: 'http://example.com/bell.mp3',

    // for advanced config flags please refer to https://hyper.is/#cfg
  },

  // a list of plugins to fetch and install from npm
  // format: [@org/]project[#version]
  // examples:
  //   `hyperpower`
  //   `@company/project`
  //   `project#1.0.1`
  plugins: [
    //'hyper-no-close',
    //'hypercwd',
    //'hyperlinks',
    //'hyperterm-atom-dark',
  ],

  // in development, you can create a directory under
  // `~/.hyper_plugins/local/` and include it here
  // to load it and avoid it being `npm install`ed
  localPlugins: []
};

I'g getting the same issue with Hyper Version 1.3.3 (1.3.3.1754) on macOS High Sierra.

My Plugins:

plugins: ['hyper-one-light', "hypercwd", "hyperlinks", "hyperterm-tabs"],
Was this page helpful?
0 / 5 - 0 ratings

Related issues

ConstantinChirila picture ConstantinChirila  ·  3Comments

ghost picture ghost  ·  3Comments

anthonyettinger picture anthonyettinger  ·  3Comments

alejandrofloresm picture alejandrofloresm  ·  3Comments

cooperpellaton picture cooperpellaton  ·  3Comments