nx icon indicating copy to clipboard operation
nx copied to clipboard

TUI: Unable to scroll

Open jeroenpol opened this issue 6 months ago • 6 comments

Current Behavior

Using: The new Terminal UI with iTerm2 on MacOS Issue: I cannot scroll (with my mouse) through the output, navigation with keyboard works. When I scroll using my mouse, I'm scrolling the full terminal output, thus moving the TUI out of view.

Expected Behavior

I would like to be able to scroll through my terminal output using the mouse

GitHub Repo

No response

Steps to Reproduce

  1. Open iTerm2
  2. Start some tasks (f.e. npx nx run-many -t serve,test -p your-app)
  3. Make sure you have enough output so the scroll bar appears
  4. Try to scroll using your mouse (both in interactive and non-interactive mode)

Nx Report

Node           : 23.11.0
OS             : darwin-arm64
Native Target  : aarch64-macos
npm            : 11.3.0

nx                     : 21.0.3
@nx/js                 : 21.0.3
@nx/jest               : 21.0.3
@nx/eslint             : 21.0.3
@nx/workspace          : 21.0.3
@nx/angular            : 21.0.3
@nx/cypress            : 21.0.3
@nx/devkit             : 21.0.3
@nx/eslint-plugin      : 21.0.3
@nx/express            : 21.0.3
@nx/module-federation  : 21.0.3
@nx/node               : 21.0.3
@nx/playwright         : 21.0.3
@nx/rspack             : 21.0.3
@nx/storybook          : 21.0.3
@nx/web                : 21.0.3
@nx/webpack            : 21.0.3
typescript             : 5.7.3
---------------------------------------
Community plugins:
@ngneat/spectator     : 19.5.0
@ngrx/component-store : 19.1.0
@ngrx/effects         : 19.1.0
@ngrx/eslint-plugin   : 19.0.0
@ngrx/operators       : 19.1.0
@ngrx/signals         : 19.1.0
@ngrx/store           : 19.1.0
@ngrx/store-devtools  : 19.1.0
@ngxs/storage-plugin  : 19.0.0
@ngxs/store           : 19.0.0
@storybook/angular    : 8.6.12
apollo-angular        : 10.0.3
ng-mocks              : 14.13.4
---------------------------------------
Cache Usage: 14.20 MB / 46.04 GB

Failure Logs


Package Manager Version

No response

Operating System

  • [x] macOS
  • [ ] Linux
  • [ ] Windows
  • [ ] Other (Please specify)

Additional Information

No response

jeroenpol avatar May 15 '25 09:05 jeroenpol

Is https://github.com/nrwl/nx/pull/31163 fixing it @FrozenPandaz ?

jogelin avatar May 15 '25 09:05 jogelin

I cannot reproduce this on iTerm2 on macOS, my iTerm window never scrolls only my terminal output

JamesHenry avatar May 16 '25 13:05 JamesHenry

@jogelin Can you reproduce?

JamesHenry avatar May 16 '25 13:05 JamesHenry

Same for me, in interactive mode with mouse reporting no scroll with mouse and selecting text includes the TUI characters

mrprkr avatar Jun 06 '25 22:06 mrprkr

Experiencing the exact same thing when scrolling the new TUI with iTerm2 on MacOS

IfyNdu avatar Jun 11 '25 11:06 IfyNdu

Same issue. using iTerm2, tmux and nx TUI. keyboard j/k can move up/down though.

yilinjuang avatar Jun 13 '25 13:06 yilinjuang

Same issue here. I'm using Ubuntu 24. Disabling it until this is fixed.

HMubaireek avatar Jun 20 '25 07:06 HMubaireek

I also was facing this on MacOS with iTerm2. If you navigate to Settings -> Advanced and set "Scroll wheel sends arrow keys when in alternate screen mode." to "Yes", scrolling should start working.

The one thing that is still not ideal is that you have to actually focus the target output you want to scroll before the scrolling will happen on that output. It would be great if the mouse hover location was enough to scroll the right output.

burtonjc avatar Jun 24 '25 21:06 burtonjc

I can't scroll at all in the IDE (Windows) or in Ubuntu's terminal using the mouse.

"...use the arrow keys to scroll up and down in the output" (https://nx.dev/blog/nx-21-terminal-ui#a-clear-overview-of-projects)

This is terrible! How am I supposed to scroll through hundreds of lines just to get back to the top?

Anomnimel avatar Jul 18 '25 10:07 Anomnimel

@Anomnimel you can disable TUI with --no-tui switch.

Saved me.

Or downgrade nx to "nx": "21.2.4", where scrolling works even in the TUI

montella1507 avatar Jul 25 '25 18:07 montella1507

+1, doesn't work for "watch" related tasks in vscode terminal / cc @JamesHenry

env:

  • zsh
  • macos
  • nx: 21.3.10

repro:

https://github.com/microsoft/fluentui-contrib/pull/453

  • undo this change https://github.com/microsoft/fluentui-contrib/pull/453/files#diff-2075dfe246c4bb78730d2ec71169b4cd707ad64bf21583aeb5476d6e174b9ec3L45
  • run NX_TUI=true yarn nx run nx-plugin:test --watch

demo:

https://github.com/user-attachments/assets/7e36d9f7-282a-4b59-bcdf-59411ce62978

  • unable to scroll up via mouse / keyboard

Hotell avatar Aug 04 '25 09:08 Hotell

My main issue with this is that now I can't copy terminal output without it being polluted by "bars".

Example:

  █
  info: ⏱  Cron jobs disabled - skipped setup. {"service":"api-client"}    █
  info: 📃 Emitted schema file to ./apps/api-client/src/schema.graphql {"s █
  ce":"api-client"}    

Anyway to disable this?

antoniojps avatar Aug 08 '25 16:08 antoniojps

Same here, when I'm trying to scroll I'm getting:

Image

pazdzioch404 avatar Aug 21 '25 00:08 pazdzioch404

I notice this does not happen if using the Nx extension in VSCode and running a task - but does happen if you directly run nx in the terminal window. I suspect this is something to do with terminal settings potentially oh my zsh?

jinder avatar Sep 01 '25 13:09 jinder

OR... they know about this problem and setting --no-tui in that extension?

montella1507 avatar Sep 01 '25 14:09 montella1507

You can see the commands that are issued and the extension is not passing "--no-tui". I can clearly see the TUI as well as it's very different.

jinder avatar Sep 01 '25 14:09 jinder

On both Mac and WSL, we can't select text and copy if it involves having to scroll. As soon as a scroll happens, the text is deselected.

flippidippi avatar Sep 08 '25 21:09 flippidippi

Same here using the built-in Terminal.app. Mouse-scrolling the output pane moves the entire TUI view off the screen.

simon-abbott avatar Sep 11 '25 22:09 simon-abbott

Same happening to me in iTerm2

SmailHammour avatar Sep 16 '25 12:09 SmailHammour

+1 same for me

JimmyBarrientos avatar Sep 30 '25 14:09 JimmyBarrientos

In case someone else would rather not have to deal with this TUI: you can disable it in nx.json: { "tui": { "enabled": false } }

siphiwe avatar Oct 04 '25 08:10 siphiwe

In case someone else would rather not have to deal with this TUI: you can disable it in nx.json: { "tui": { "enabled": false } }

You can also use export NX_TUI=false or --tui=false. We currently have it enabled in the nx.json and people can turn it off it they want.

flippidippi avatar Oct 06 '25 15:10 flippidippi

Also getting a bunch of

^[[B^[[B^[[B^[[B^[[B^[[B^[[B^[[B^[[B^[[B^[[B^[[B^[[B^[[B^[[B^[[B^[[B^[[B^[[B^[[B^[[B^[[B^[[B^[[B

when trying to scroll (either with trackpad/wheel or keys)

Entering interactive mode by pressing ^+z helped.

Edit: Note, this will disable bindings such as h+enter etc


OS: Mac Shell: zsh

mruknowme avatar Oct 08 '25 00:10 mruknowme

I started to run my nx commands with the --tui=false and that solves the problem for me. Actually, I will look if it is possible to leverage that flag on any command by default, and only use the nx terminal on demand (it is handy in some of our business case )

holylander avatar Oct 16 '25 14:10 holylander

Another great feature noone asked for, brings multiple bugs and requires me to change configuration to disable it. Gotta love NX lately.

faileon avatar Oct 23 '25 09:10 faileon

Another great feature noone asked for, brings multiple bugs and requires me to change configuration to disable it. Gotta love NX lately.

Probably inspired from Angular team itself. They are doing things noone has asked for (deprecating things etc) and not fixing 4+ years critical bugs and strange behavior.

montella1507 avatar Oct 23 '25 10:10 montella1507

this is very easy to solve @faileon, no need for such kind of feedback 😅. I indeed find it useful on certain scenarios

On the other hand, you can just disable it globally, see the tui details

"tui": {
    "enabled": false
  }

or disable it per command or task, as for instance, "test": "NX_TUI=false nx test", or adding --tui=false to ur nx command

holylander avatar Nov 03 '25 17:11 holylander

this is very easy to solver @faileon, no need for such kind of feedback 😅. I indeed find it useful on certain scenarios

On the other hand, you can just disable it globally, see the tui details

"tui": {
    "enabled": false
  }

or disable it per command or task, as for instance, "test": "NX_TUI=false nx test",

I don't know, I signed up for a build tooling and lately I'm getting AI assistants, changes to the output of my terminal and things like "yolo" mode for CI... Meanwhile my cache is still flaky for last 3 major versions, like wtf is going on?

faileon avatar Nov 03 '25 18:11 faileon

Hi Folks, we've got a set of usability enhancements coming to help folks who are not as familiar with how terminal user interfaces (TUIs) and pseudo-terminals (ptys) work, we'll provide an update on here very soon. There are distinctions about what keybindings get interpreted by the TUI and what get interpreted by the pty. We think we've come up with a self-explaining/documenting way to handle it that will land in an upcoming patch.

@faileon There is no such thing as yolo mode for CI, I think you must be referring to a YouTube video which is obviously intended to for one purpose - to grab attention in a sea of other videos.

Nx Cloud's self-healing CI is now capable of auto-committing a suggested fix back to your PR (note: never your main branch) but ONLY if (A) you have told it specifically what tasks you want it do that for and (B) the suggested fix has already been applied and caused the previously failing task to pass (making it a verified fix).

If you are experiencing unexpected cache hits or misses, it is very likely that inputs are misconfigured for whatever reason. Please check out the tools available to you to figure out where that is happening in your setup: https://nx.dev/docs/troubleshooting/troubleshoot-cache-misses - if, after you have been through those steps, you feel you have found a bug please open a fresh issue with full context so that we can help.

JamesHenry avatar Nov 07 '25 07:11 JamesHenry

Hey all! We made a change in Nx v22.1.0 to disable interactive mode by default for terminal outputs, which alleviates this issue for many tasks that didn't require interactive mode. This means that for interactive outputs, you'll need to press i to enable it before interacting with the terminal.

We're exploring additional UX improvements in this area, so stay tuned.

leosvelperez avatar Nov 24 '25 15:11 leosvelperez