1

Every time I open a new terminal window it opens on top of the last one I opened. I would like it to be opened in the middle of my screen.

I've tried editing org.pantheon.terminal.saved-state opening-x and opening-y but it only works for the first one I open. Once I position the terminal, the next one opens in that same position.

I'm running Loki.

Thanks.

2

pantheon-terminal is set to periodically update a saved state variable with your terminal's position. You can flush it out with the following commands:

gsettings reset org.pantheon.terminal.saved-state opening-x

gsettings reset org.pantheon.terminal.saved-state opening-y

but unless you run these right before you open a new window, any additional windows are coded to overlay the original. (One would think that they should at least cascade... I think that's worthy of a bug report.)

Your only other option would be to download and recompile pantheon-terminal while commenting out the lines that recall the positional saved state. This would mean commenting out the following two lines in /src/PantheonTerminalWindow.vala and recompiling as you wish:

    if (restore_pos) {
        int x; # = saved_state.opening_x;
        int y; # = saved_state.opening_y;

        if (x != -1 && y != -1) {
            move (x, y);
        } else {
            x = (Gdk.Screen.width ()  - default_width)  / 2;
            y = (Gdk.Screen.height () - default_height) / 2;
            move (x, y);
        }
    }

A jury-rigged alternative would be to only open Terminal from a custom keyboard shortcut (or link) and to have that shortcut trigger a simple script that resets those two variables and opens another instance of pantheon-terminal. (Let me know if you would like help with that.) The best solution would likely to be filing a bug report so we can see if we can't get this entire function to be toggle-able in org.pantheon.terminal.settings...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.