** Attachment added: "Screenshot at 2026-10-27 07-04-28.png"
   
https://bugs.launchpad.net/ubuntu/+source/caja/+bug/2172282/+attachment/6012921/+files/Screenshot%20at%202026-10-27%2007-04-28.png

** Description changed:

  ### 1. Affected Package revision / version
  
  Ubuntu MATE 24.04 (tested using `ubuntu-mate-24.04-desktop-amd64.iso` to
  ubuntu-mate-24.04.5-desktop-amd64.iso (the current release at this
  writing) tested)
  
  ---
  
  ### Environment
  
  * **Desktop Environment:** MATE 1.26
  * **File Manager:** Caja
  * **Text Editor:** Pluma
  * **MIME Library:** GLib / GIO / shared-mime-info
  
  ---
  
  ### 2. Steps to Reproduce
  
  1. Create a 0-byte file (e.g., via `touch "new file"` or by right-clicking on 
the desktop → **Create Document** → **Empty File**).
  2. Attempt to open or double-click the file in Caja.
  
  ---
  
  ### 3. Current Behavior
  
  Triggering the file opens an error dialog:
  
- > *"There is no application installed for Empty document files. Do you
- want to search for an application to open this file?"*
+ > Could not display "/home/ubuntu-mate/Desktop/new file"
+ > There is no application installed for Empty document files. Do you want to 
search for an application to open this file?
+ > [ No ] [ Yes ]
  
  Clicking "Yes" does nothing because packagekit/sessioninstaller
  integration is unhandled or missing by default, leaving the user unable
  to open empty text files natively in Pluma.
  
  ---
  
  ### 4. Expected Behavior *(optional)*
  
  Zero-byte text files should open directly in Pluma (the default text
  editor), consistent with how `text/plain` files behave.
  
  ---
  
  ### 5. Workaround *(optional)*
  
  * **System-Level Workaround (First Session Script):**
  Deploy a script on new user creation / first login session that runs:
  ```bash
  xdg-mime default pluma.desktop application/x-zerosize
  
  ```
  
  This automatically creates or updates `$HOME/.config/mimeapps.list` with:
  ```ini
  [Default Applications]
  application/x-zerosize=pluma.desktop
  
  ```
  
  * **User-Level Terminal Workaround:**
  Run the command directly in the terminal:
  ```bash
  xdg-mime default pluma.desktop application/x-zerosize
  
  ```
  
  * **User-Level GUI Workaround:**
  1. Right-click any 0-byte file in Caja and select **Open With Other 
Application...**.
  2. Select **Pluma Text Editor**.
  3. Ensure **"Remember this application for 'Empty document' files"** is 
checked.
  4. Click **Open**.
  
  * **Template-Based Workaround (Bypassing Desktop 0-Byte Creation):**
  Right-clicking on the desktop → **Create Document** → **Empty File** 
generates a 0-byte file named `"new file"` by default, immediately triggering 
this issue. You can avoid the 0-byte threshold for desktop-created files by 
populating a custom template:
  ```bash
  mkdir -p ~/Templates && echo "" > ~/Templates/"Text Document.txt"
  
  ```
  
  This creates a 1-byte file containing a single blank line. Having this
  template makes "Text Document" appear as an option when you right-click
  in Caja and select **Create Document**, bypassing 0-byte detection
  entirely for files created through that menu. *(Note: Standard 0-byte
  files created via `touch` or other means will still require the MIME fix
  above).*
  
  ---
  
  ### 6. Suggestions, Investigation and Possible Causes *(optional)*
  
  * **Root Cause:** In both Ubuntu MATE 22.04 and Ubuntu MATE 24.04, 
`/usr/share/applications/mate-mimeapps.list` correctly contains 
`text/plain=pluma.desktop;`. However, GLib's fast-content-type detection 
changed between versions.
  * **Comparison:**
  * **Ubuntu MATE 22.04:**
  ```bash
  $ touch "new file"
  $ gio info "new file" | grep 'standard::fast-content-type'
  standard::fast-content-type: text/plain
  
  ```
  
  * **Ubuntu MATE 24.04:**
  ```bash
  $ touch "new file"
  $ gio info "new file" | grep 'standard::fast-content-type'
  standard::fast-content-type: application/x-zerosize
  
  ```
  
  Because `application/x-zerosize` lacks a default mapping out-of-the-box
  in Ubuntu MATE 24.04, Caja fails to resolve a handler. The fix is very
  straightforward to apply.
  
  ---
  
  ### 7. Other Tests *(optional)*
  
  Tested using `ubuntu-mate-24.04-desktop-amd64.iso`, confirming the
  regression is present here while it did not occur in Ubuntu MATE 22.04.
  Note that right-clicking on the desktop → **Create Document** → **Empty
  File** generates a 0-byte file named `"new file"` by default,
  immediately triggering this issue unless a non-empty template file is
  used.
  
  ---
  
  ProblemType: Bug
  DistroRelease: Ubuntu 24.04
  Package: caja 1.26.3-1build3
  ProcVersionSignature: Ubuntu 7.0.0-31.31~24.04.1-generic 7.0.14
  Uname: Linux 7.0.0-31-generic x86_64
  NonfreeKernelModules: zfs
  ApportVersion: 2.28.3-0ubuntu0.1
  Architecture: amd64
  CasperMD5CheckResult: pass
  CasperVersion: 1.498
  CloudArchitecture: x86_64
  CloudID: nocloud
  CloudName: unknown
  CloudPlatform: nocloud
  CloudSubPlatform: seed-dir (/var/lib/cloud/seed/nocloud)
  CurrentDesktop: MATE
  Date: Tue Oct 27 06:44:01 2026
  LiveMediaBuild: Ubuntu-MATE 24.04.5 LTS "Noble Numbat" - Release amd64 
(20260909)
  ProcEnviron:
   LANG=C.UTF-8
   PATH=(custom, no user)
   SHELL=/bin/bash
   TERM=xterm-256color
   XDG_RUNTIME_DIR=<set>
  SourcePackage: caja
  UpgradeStatus: No upgrade log present (probably fresh install)

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2172282

Title:
  Opening 0-byte text files triggers "No application installed" error
  due to application/x-zerosize MIME regression

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/caja/+bug/2172282/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to