Results 1 to 2 of 2

Thread: How to prevent CLI command from using GUI

  1. #1
    Join Date
    Feb 2019
    Beans
    7

    How to prevent CLI command from using GUI

    Hello,
    Is there a way to prevent CLI commands from opening windows in the GUI?

    For example, in Ubuntu 18.04.2:
    - mtr (my traceroute) spawns a GTK windows in the middle of the screen, effectively covering a large part of it. I would like it to run in the split-screen terminal where I typed the command. This way I can stop and restart it, or use a different IP, without having to move a window manually each time.
    - when using a password-protected SSH key, I would like the prompt for the password to be in the terminal. The GUI one prevents me from copying the password from Keepass.

    Thank you

  2. #2
    Join Date
    Jan 2007
    Beans
    768
    Distro
    Ubuntu 18.04 Bionic Beaver

    Re: How to prevent CLI command from using GUI

    mtr on my Ubuntu 18.04 doesn't open any windows, and in fact the -g and --gtk options don't work. Did you install a different version of mtr, or GTK+? Or a different desktop manager? You said Ubuntu, not Kubuntu or Xubuntu or Lubuntu, so I'm assuming the normal gnome 3.

    ssh shouldn't open any windows either if you're using the command line tools. Maybe you're running a ssh agent that has a GUI?

    The command unset DISPLAY will cause the shell in that terminal to "forget" you're in a GUI environment and prevent anything launched from that shell from accessing the GUI display as well.
    Last edited by kpatz; June 18th, 2019 at 03:25 PM.
    Current 'buntu systems: multiple systems running Server or Desktop 22.04 LTS / Retired or Upgraded: 18.04.2 LTS, Mythbuntu 16.04 LTS, Ubuntu 16.04.1 LTS, 14.04 LTS, 10.04 LTS, 8.04 LTS
    Been using ubuntu since 6.04 (16 years!)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •