Bug 496947 - Incorrect default folder when opening a new tab
Summary: Incorrect default folder when opening a new tab
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: gnome-terminal
Version: 11
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Behdad Esfahbod
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 495910 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-04-21 18:47 UTC by Mathieu Bridon
Modified: 2010-01-14 18:06 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-01-14 18:06:32 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Mathieu Bridon 2009-04-21 18:47:05 UTC
Description of problem:
Somewhere between  gnome-terminal-2.24.3 and gnome-terminal-2.26.1, gnome-terminal's CWD changed to / and now it seems like terminal_screen_get_current_dir is returning / when it can't chdir to the target working dir.


Version-Release number of selected component (if applicable):
gnome-terminal-2.26.1-1.fc11.x86_64


How reproducible:
Always


Steps to Reproduce:
1. Open a gnome-terminal as your normal user
2. $ su -
  => You get a root shell in /root
3. CTRL + SHIFT + T
  => you get a new tab as your normal user in /

Alternatively:
1. $ cd /tmp
2. $ mkdir foo
3. $ cd foo
4. $ chmod a-x .
5. CTRL + SHIFT + T
  => you get a new tab as your normal user in /

Expected results:
Opening new tab in both of these cases should open a shell as your normal user in its $HOME.

Additional info:
1. $ cd /tmp
2. $ mkdir foo
3. $ cd foo
4. don't do the « chmod a-x . » so that /tmp/foo is 755
5. CTRL + SHIFT + T
  => you get a new tab as your normal user in /tmp/foo, which is expected.


Thanks a lot to wwoods and nanonyme in #fedora-qa for helping me understand  the issue and for digging it.

Comment 1 Matthias Clasen 2009-04-21 19:08:46 UTC
Related bug: http://bugzilla.gnome.org/show_bug.cgi?id=579291

Comment 2 Matthias Clasen 2009-04-21 19:09:42 UTC
http://bugzilla.gnome.org/show_bug.cgi?id=525450

Comment 3 Mathieu Bridon 2009-04-21 19:24:57 UTC
Actually, those 2 bugs are not the same issue as the one I reported.

Those 2 complain about the fact that new tabs are opened in the same folder as the tab you were in before opening the new one.

I'm not complaining about that, I _love_ this behaviour.

The issue here is that if it's not possible to chdir to this dir when opening the new tab (the x bit is not set), you're left in / when you should be left in $HOME.

Comment 4 Will Woods 2009-04-21 19:50:29 UTC
I'm guessing this bug stems from the fact that F-10 gnome-terminal (2.24.x) ran with cwd=$HOME:

  home_dir = g_get_home_dir ();
  if (home_dir)
    g_chdir (home_dir);

  gtk_main ();

2.26.x changed to cwd=/, due to http://bugzilla.gnome.org/show_bug.cgi?id=565328:

  if (chdir ("/") < 0)
    g_warning ("Failed to chdir to /: %s", g_strerror (errno));

  gtk_main ();

Perhaps terminal_screen_launch_child should chdir() to the user's homedir before calling vte_terminal_fork_command() - then if vte_terminal_fork_command() fails to chdir(), we'll end up in $HOME instead of /.

Comment 5 Matthias Clasen 2009-04-21 22:53:34 UTC
I've reopened the upstream bug and added some comments there.

Comment 6 Matthias Clasen 2009-04-22 20:22:11 UTC
Can you try gnome-terminal-2.26.1-2.fc11, which has the proposed upstream fix ?

Comment 7 Mathieu Bridon 2009-04-22 21:29:38 UTC
Just installed it.

That fixes the first case I mentioned (tab1 as root then CTRL + SHIFT + T), but not the second one (tab1 as same user but in a folder you don't have exec permission).

That's weird, we figured it was the same problem for both :-/

Comment 8 Will Woods 2009-05-27 21:05:43 UTC
*** Bug 495910 has been marked as a duplicate of this bug. ***

Comment 9 Bug Zapper 2009-06-09 14:20:40 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 11 development cycle.
Changing version to '11'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 10 Mathieu Bridon 2009-06-20 09:55:59 UTC
Still present with gnome-terminal-2.26.2-1.fc11.x86_64

Comment 11 Need Real Name 2009-11-18 12:52:09 UTC
Seems fixed in gnome-terminal-2.28.1-1.fc12.x86_64

Comment 12 Mathieu Bridon 2009-11-18 19:31:52 UTC
As the initial reporter, I confirm both issues are fixed in F12 (same version as comment #11).

Comment 13 Need Real Name 2010-01-06 14:52:22 UTC
mark as closed currentversion?


Note You need to log in before you can comment on or make changes to this bug.