Score:2

How to open files with name starting in "." in a program

cn flag

Let's say I already a open Gedit window and I want to edit the file .bashrc, which I haven't edited recently. I should click on the 'Open' button, navigate to my home directory and click on the file to open it.

That is not possible since when a "Open File" window shows on screen it doesn't display any file starting with "."

And that is not only for Gedit: I have tried with multiple programs but the problem still remain, even when normally Nautilus shows them when working as a standalone. I know I can open files with Gedit using my terminal, but is it possible to open them with the GUI?


Doing some tests for this question I discovered a weird interaction:

When I

  1. Open Nautilus
  2. Check the "Mark my hidden files as visible" box to make them visible
  3. Close Nautilus
  4. Open any other program
  5. Select the Open Button (Doesn't show hidden files)
  6. Close the popup
  7. Close the program
  8. Open back Nautilus

Then the checkbox clicked on step 2 on Nautilus is not checked anymore

BUT

When I

  1. Open Nautilus
  2. Check the "Mark my hidden files as visible" box to make them visible
  3. Open any other program (Nautilus still open)
  4. Select the Open Button (Now it shows hidden files)
  5. Close the popup

Then Nautilus will keep the checkbox marked!

I don't know if the checkbox stays marked even after a system reboot: I'm rebooting just after this question is posted and I'll edit this question if the check disappears.


EDIT

While making more tests to monitor this weird interaction I tried using VSCode instead of Gedit. For some obscure reason seems that when clicking on "open file" on VSCode it overwrites my settings, making my "Mark hidden files as visible" unchecked and making my hidden files invisible once again. I tried the trick from before, keeping both Nautilus and Gedit open while clicking on the "open file" button in VSCode, but the settings were overwritten and the checkbox got unmarked when the Nautilus popup was closed.


EDIT N2

Seems I'm not the only one experiencing this kind of problem with VSCode. Here there's a link to an open github issue with the same problem I'm having.

sudodus avatar
jp flag
From a terminal window `gedit ~/.bashrc`. From Nautilus you must first make it show hidden files. Then look into you home directory and you can doubleclick to open also `.bashrc`. The setting to show hidden files should survive reboot.
Tox46 avatar
cn flag
@sudodus I did, as written in the second part of my question
Score:6
cn flag

In the "File - Open" box, hit Ctrl+H to toggle the display of hidden files. You can also right-click in the file list and select "Show hidden files" from the right-click menu. That at least answers the "How to open files with name starting in "." in a program".

The same shortcut key works in nautilus. In nautilus, the setting propagates to all open instances when you change it in one instance. In contrast, GTK3 file dialogs take their initial state from how it was set through nautilus, but can then be changed individually and are remembered for the application as long as it remains open. That, at least, is how it works for several applications, including Gedit and LibreOffice. VSCode, however, may be resetting the dialog settings each time it is closed. GTK2 file open dialogs, such as in Gimp, remember their settings within the application between restarts.

At least, that is how it works on my system: I cannot reproduce the issue you are describing, not on Ubuntu 21.04 with Gnome 40 from PPA, nor on a standard install of Ubuntu 20.04.

Tox46 avatar
cn flag
I tried your solution. When clicking CTRL+H in my VSCode file picker it does shows hidden files, and it keeps the check on when opening back Nautilus. When opening back a VSCode popup it seems like I haven't done anything, and CTRL+H has not been pressed
vanadium avatar
cn flag
VSCode may be interfering. Please also try with for example Gedit, another Gnome app.
Tox46 avatar
cn flag
Gedit seem to work as intentended using your solution. VSCode must be doing something weird with the file picker.
vanadium avatar
cn flag
VCCode may reset the dialog each time, whereas for other applications, the state is remembered while the app is open. If an app is closed then opened again, initially the GTK dialogs will take the status as in nautilus.
Tox46 avatar
cn flag
Searching on the internet with VSCode as main keyword pops an open github issue that points out exactly at the issue I'm experiencing. Thanks for your time
rexkogitans avatar
cn flag
Just a side note from someone who is coding in Linux since several years: There are tons of good editors in Linux around. I am working with Geany which is a GTK application and hence integrates with the GNOME infrastructure perfectly. There is no need to mess the GNOME Look and Feel with MS apps.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.