3

I am running Ubuntu 16.04 LTS

I opened up terminal and went Preferences > Profiles > Command, and checked both Run command as a login shell and Run a custom command instead of my shell and I changed the drop-down menu to Exit the terminal.

My problem is now every time I open terminal, it closes before I can open the preferences again and I couldn't find anything on the Internet about how to fix it. I have the ability to connect through SSH if I need to run any commands and I'm wondering if there is any files I can modify to fix this. Thanks!

Bradley
  • 31
  • 1
  • 1
  • 5
  • Are you using gnome-terminal (i.e. the default one from Ubuntu)? If so, one idea would be to search inside your $HOME directory for its settings. Maybe with a find $HOME -iname '*terminal*' – thiagowfx Apr 24 '17 at 03:48
  • A second idea would be to find its settings with either dconf or gsettings. – thiagowfx Apr 24 '17 at 03:49
  • 1
    Thanks for the quick reply. I used XTerm to use the command 'dconf reset -f /org/gnome/terminal/legacy/profiles:/' (Sorry commented too soon there before). Thanks for the help :) @thiagowfx – Bradley Apr 24 '17 at 04:57
  • This does not really fix your problem, right? You are just using a different terminal. Anyway, at least you can be productive meanwhile :) – thiagowfx Apr 24 '17 at 04:59
  • It did fix the problem just commented too soon :P – Bradley Apr 24 '17 at 05:01
  • Haha, glad you got it! I guess the hardest part was to figure out the entry to reset. How did you find it out? – thiagowfx Apr 24 '17 at 05:03
  • I would like to say pure skill but I just used your suggestions as keywords and searched it up more online. – Bradley Apr 24 '17 at 05:06
  • In newer gnome-terminal versions you can use the command gnome-terminal --preferences. Alas it's not yet available in Ubuntu 16.04. – egmont Apr 24 '17 at 11:19
  • Can you mark you query as "solved" by selecting an answer ? If needed please write up yr own answer and mark it as the answer so that, in the spirit of SE, others may benefit from yr successful troubleshooting. Cheers. – Cbhihe Oct 12 '17 at 18:05

7 Answers7

4

I had the same problem. I found this solution:

  1. open xterm

  2. type this command: gnome-terminal -e -ls [the bash shell (gnome-terminal) will be open (instead close), because it try to execute another command then the other established in the profile configuration]

  3. change the profile configuration.
Anthon
  • 79,293
2

You won't have to install any program or remove any file.

To edit your gnome-terminal preferences, without actually opening or using  gnome-terminal:

  1. Go to: root/usr/share/applications

  2. locate Terminal in the folder.

  3. Then open its properties by right clicking on Terminal. You'll then see the command.

This is actually what happens when you open terminal.

So to edit the preferences; change the command gnome-terminal to gnome-terminal --preferences... Voila!

After "repairing" the settings. Just close the preferences and then remove --preferences from the command in the properties window. Now just open the terminal as you would.

Kevdog777
  • 3,224
0

No necro-posting here (OP is already 6 months old) but I had the same issue and was locked out of my one available desktop gnome-terminal, with no way to download and install another one, apart from dropping to console. Similarly to OP I had set gnome-terminal up and ran an invalid custom command instead of my shell.

My "desktop" solution was to reset gnome-terminal's settings by way of dconf.

Just navigate to /org/gnome/terminal, highlight "legacy", right click and choose "reset recursively" ... (in the end, a very minor case of cold sweat).

In the process you will lose yr gnome-terminal settings and any profile you had. However relaunching terminal and starting again from scratch becomes immediately possible.

HTH future lx apprentice sorcerers.

Cbhihe
  • 2,701
0

I used dconf tool to work on my way to /org/gnome/terminal/profiles/xxxprofile. Cleared the entry in "custom-command" box, unchecked "use-custom-command" checkbox and cleared the entry in the "visible-name" box. Terminal function returned to normal.

GordK
  • 1
0

What I actually did was to install dconf then open dconf-editor and going to org/gnome/terminal/legacy/keybindings/preferences, setting the shortcut to <Ctrl><Shift>r (any other not used would do as well) and pressing it before the terminal closes. I went on from there and removed the preference I had made. Having tried everything else, this was my last idea and it worked.

0

Easiest Way to correct this is : Steps:

  1. Type terminal in app launcher.
  2. right click on terminal icon and select preferences.
  3. go to unnamed.
  4. go to command.
  5. uncheck first two .
0

I had the same issue, what we need to do is run another command in the terminal to hold it open.

STEPS:

  1. Create a file anywhere in your file system say bash.sh

  2. Paste the following into it:

#! /bin/bash
bash
  1. Make it executable: Right click > properties > permissions > <tick the checkmark for execute> > close

  2. Double click on the file > Run in terminal

You should have the terminal open now

Shade
  • 1