Cannot rename files or folders in Nautilus

6,221

Solution 1

I believe you are suffering from a side effect of having Focus follows mouse turned on. When you choose rename from the drop down menu, the menu disappears leaving the pointer over empty space in the window which then takes focus away from the folder name and the unwanted results are exactly as described in Steves answer.

To resolve this problem, use Compiz Config Settings Manager. If you don't have it you can install it as follows:

1) Enable the Universe Repository.

2) Install Compiz Config Settings Manager either from the software center or via the terminal with sudo apt-get update && sudo apt-get install compizconfig-settings-manager

One installed, run it and click OK regarding the caution.

Choose General, then General options.

Choose the Focus and Raise behavior tab and match the settings as shown below:

ccsm-focus

Note that Auto-Raise is unchecked. You should likely also look at the next tab over key bindings and insure that the Raise Window bindings for keyboard and mouse are disabled or at least set in a manner that you aren't inadvertently triggering them.

To accomplish the same result with Unity Tweak Tool change your settings to match as shown below:

Note that auto raise is off.

unity-tweak-settings

Edit: If all else fails, as a workaround try nemo (a fork of nautilus) that has worked for me when nautilus was acting up.

If anything about this answer is unclear, please drop me a comment and I'll do my best to clarify.

Solution 2

It seems like this may be a bug in Nautilus, you may need to use the terminal to rename files for the time being until this bug gets fixed. This also could be a file permission issue.

Open up a terminal window and type in the following command to view the folder permissions:

cd temp && ll

Once you have done this, type in the following command (keep in mind you will need super user privileges for this, and NewFolderName would be the new name of the folder):

sudo mv "./Untitled Folder" "./NewFolderName"

Of course, if you do not feel comfortable with using the command line every time you want to rename files or folders, perhaps you could try a different file manager like Thunar.

To install Thunar, open up a terminal window and type in the following command:

sudo apt install thunar

Solution 3

It's simply a behavioural issue, nothing is going wrong here, let me explain

The folder has been created with a default name, you use the F2 key to change the name You don't change file/folder names in Nautilus by clicking on the text of the item, you must press F2

If you begin to enter text in Nautilus like this you will simply be running a search in the folder that is open for something beginning in said text, here you have searched for the term test, if there is more then one item that begins with the word test you use the cursor keys to navigate your selection

If you find yourself uncomfortable with the GNOME shell, you may want to consider using KDE, or Kubuntu, you may even want to install KDE alongside your GNOME Unity shell, "sudo apt-get install kubuntu-full" in your terminal will do this for you, feel free to explore some of the smaller desktop environments, some will give you a real performance boost if you are trying to be minimalistic, but that goes out of the scope of this question...... Explore!

If you are loosing focus, there maybe something wrong with your keyboard setup or another application may be stealing it, shift keys come in handy when you are in rename mode

Forgive me if I lost focus on the topic here

Share:
6,221

Related videos on Youtube

Alexander Zeitler
Author by

Alexander Zeitler

Updated on September 18, 2022

Comments

  • Alexander Zeitler
    Alexander Zeitler over 1 year

    As of today I'm facing this behavior in Ubuntu 16.04 Nautilus:

    I create a new file/folder by right clicking in Nautilus "New Folder". When I focus the folder name to edit it, the focus gets lost and I can't edit the name.

    Nautilus looks like this while typing the name of the folder: enter image description here

    In addition, when I try to hit Del while trying to edit the name, the file/folder gets deleted. If I hit Backspace, Nautilus navigates back to the parent folder.

    I validated no key is stuck and rebooted Ubuntu. Nothing did fix it.

    Update: When switching Nautilus to grid view, everything works fine.
    Update 2: I also tried

    sudo apt-get update
    sudo apt-get install --reinstall ubuntu-desktop
    sudo apt-get install unity
    

    Update 3: I disabled Auto-Raise using ccsm: enter image description here

    I also disabled Raise-Windows keyboard and mouse bindings: enter image description here

    Update 4:

    Output of dpkg -l nautilus*:

    Desired=Unknown/Install/Remove/Purge/Hold
    | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
    |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
    ||/ Name                                                                                   Version                                          Architecture                                     Description
    +++-======================================================================================-================================================-================================================-=================================================================================================================================================================================
    ii  nautilus                                                                               1:3.18.4.is.3.14.3-0ubuntu5                      amd64                                            file manager and graphical shell for GNOME
    ii  nautilus-data                                                                          1:3.18.4.is.3.14.3-0ubuntu5                      all                                              data files for nautilus
    un  nautilus-dropbox                                                                       <none>                                           <none>                                           (no description available)
    un  nautilus-open-terminal                                                                 <none>                                           <none>                                           (no description available)
    ii  nautilus-sendto                                                                        3.8.2-1ubuntu1                                   amd64                                            integrates Evolution and Pidgin into the Nautilus file manager
    un  nautilus-sendto-empathy                                                                <none>                                           <none>                                           (no description available)
    ii  nautilus-share                                                                         0.7.3-2ubuntu1                                   amd64                                            Nautilus extension to share folder using Samba
    
    • b_laoshi
      b_laoshi about 7 years
      What happens if you select the folder in nautilus and press F2? Does that put the folder name in edit mode?
    • Alexander Zeitler
      Alexander Zeitler about 7 years
      Yes it gets in edit mode and as soon as I hit a key it exits edit mode.
    • b_laoshi
      b_laoshi about 7 years
      I've never seen that one before. Have you tried purging (sudo apt-get remove --purge nautilus) and reinstalling (sudo apt-get install --reinstall nautilus)?
    • Alexander Zeitler
      Alexander Zeitler about 7 years
      Purge / reintall didn't fix it.
    • Alexander Zeitler
      Alexander Zeitler about 7 years
      Seems at least one other person did face this as well also his fix didn't work for me: bugs.launchpad.net/ubuntu/+source/nautilus/+bug/1574614
    • Jacob Vlijm
      Jacob Vlijm about 7 years
      Silly question, but what happens if you (temporarily) rename ~/.config/nautilus? Possibly, local nautilus files are corrupted. Run nautilus -q && mv ~/.config/nautilus ~/.config/backup_nautilus && nautilus. If it does not work, simply rename it back.
    • Alexander Zeitler
      Alexander Zeitler about 7 years
      @JacobVlijm tried it - didn't help
    • Jacob Vlijm
      Jacob Vlijm about 7 years
      Shoot. Sorry to hear.
    • Alexander Zeitler
      Alexander Zeitler about 7 years
      @cl-netbox Thanks, tried it but it did fix it.
    • Alexander Zeitler
      Alexander Zeitler about 7 years
      @cl-netbox sorry for the typo: it didn't fix it.
    • aleskva
      aleskva about 7 years
      What about uninstalling Nautilus (by apt-get purge) at all, removing all in .config or .cache or .local/share and other Nautilus folders and then clean install? If this would not work, then this is not a Nautilus error. After this prove you can test if some Nautilus dependency package is not corrupted
    • aleskva
      aleskva about 7 years
      I think I've had the same issue before, but unfortunately I didn't remember a solution. I just recommend what I would try first
    • aleskva
      aleskva about 7 years
      *and other Nautilus folders inside /home of course
    • Admin
      Admin about 7 years
      Failed to reproduce this in Ubuntu 16.04 Live session. The said bug or weird behaviour might have something to do with upgraded systems that had caused messy config.
    • Elder Geek
      Elder Geek about 7 years
      I've also recently had strange issues with nautilus. Perhaps my solution will help you as well.
    • Elder Geek
      Elder Geek about 7 years
      What desktop environment are you using?
    • Alexander Zeitler
      Alexander Zeitler about 7 years
      I'm using Unity.
    • Elder Geek
      Elder Geek about 7 years
      Please be so kind as to edit the output of dpkg -l nautilus* into your post. Thank you for helping us help you! :-)
    • doug
      doug about 7 years
      You don't "focus a folder name" to rename, you right click on it > rename
    • Elder Geek
      Elder Geek about 7 years
      Do you get the same results if you launch nautilus with nautilus --force-desktop
    • Alexander Zeitler
      Alexander Zeitler about 7 years
      yes, same behavior
    • Alexander Zeitler
      Alexander Zeitler about 7 years
      Output of dpkg -l nautilus* added to question...
    • userDepth
      userDepth about 7 years
      This used to happen to me with a stuck SHIFT key
    • Wladek Surala
      Wladek Surala over 4 years
      I fixed it, check my answer below:)
  • b_laoshi
    b_laoshi about 7 years
    If he just created the folder from within nautilus, how could the permissions be set such that he would not be able to rename the folder he just created?
  • pauljohn32
    pauljohn32 about 7 years
    Something funny is going on, better to get the facts than assume reinstalling the gui program will help. We dont know what "temp" is, where it came from. It might be a symlink to a weird directory. If you suspect the gui is bad, I would install another file manager (Thunar, Dolphin, etc) to see if they also have quirk. But I rather have info on temp and content within.
  • Alexander Zeitler
    Alexander Zeitler about 7 years
    That's what I'm trying to do: create new folder -> start typing. I'm creating new folders via CTRL+Shift+N instead of using the Nautilus menus. Renaming happens by hitting F2 and causes the same effect.
  • Elder Geek
    Elder Geek about 7 years
    Can you confirm that you have Focus follows mouse turned off?
  • Alexander Zeitler
    Alexander Zeitler about 7 years
    Yes, it is set to "click"
  • Elder Geek
    Elder Geek about 7 years
    Where would I look to see this "click" setting you refer to?
  • Alexander Zeitler
    Alexander Zeitler about 7 years
    Unity Tweak Tool -> Workspace Settings -> Additional -> Focus Mode
  • Alexander Zeitler
    Alexander Zeitler about 7 years
    I checked your updated answer but disabling the raise options didn't fix it.
  • Elder Geek
    Elder Geek about 7 years
    Did you use ccsm and check the keybindings?
  • Alexander Zeitler
    Alexander Zeitler about 7 years
    Yes, I updated my question so you can validate it.
  • Alexander Zeitler
    Alexander Zeitler about 7 years
    I installed nemo and this solves the problem. I tried to make nemo the default manager but when e.g. saving in Chrome, it still uses the Nautilus dialog.
  • Elder Geek
    Elder Geek about 7 years
  • Alexander Zeitler
    Alexander Zeitler about 7 years
    This now also happens using nemo.