https://bugs.kde.org/show_bug.cgi?id=519979

            Bug ID: 519979
           Summary: Empty "Command" field in profile triggers "Could not
                    find" warning instead of resolving the user's login
                    shell via getpwuid()
    Classification: Applications
           Product: konsole
      Version First 26.04.1
       Reported In:
          Platform: Arch Linux
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: general
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: ---

When a user wants their Konsole profile to follow their login shell as
  configured in /etc/passwd (so that running `chsh -s <new_shell>` is           
  respected without manually editing the profile), the natural action is        
  to clear the "Command" field in the profile editor.                           

  Two distinct behaviors exist:                                                 

    1. If the line `Command=` is **absent** from the profile file               
       (~/.local/share/konsole/<profile>.profile), Konsole correctly
       resolves the user shell at runtime via getpwuid(), respecting any        
       subsequent `chsh` change.                                                

    2. If the field is **cleared via the GUI** (Settings > Edit Current         
       Profile > General > Command), Konsole serializes the empty value         
       as a literal `Command=` line. On the next launch this triggers:          

           Warning: Could not find «», starting «/usr/bin/zsh» instead.         
                    Check your profile configuration.                           

       and the displayed fallback (e.g. /usr/bin/zsh) is then *captured*        
       as the active shell for that session. After `chsh -s /usr/bin/fish`,
       Konsole still launches the previously captured zsh, defeating the        
       user's intent.                                                           

  The GUI thus offers no way to express "use the login shell from               
  /etc/passwd dynamically" — you must either (a) hardcode a specific
  binary path, losing the dynamic lookup, or (b) hand-edit the profile          
  file to delete the `Command=` line, which the GUI may regenerate.             

  Steps to reproduce                                                            
  ------------------                                                            
  1. Open Konsole, Settings > Edit Current Profile > General.
  2. Clear the "Command" text field.                                            
  3. OK / Apply, close the profile dialog.
  4. Close Konsole. Reopen.                                                     
  5. Observe the warning + captured shell.                                      
  6. Run `chsh -s /usr/bin/fish` (or any other shell change).                   
  7. Reopen Konsole.                                                            

  Actual result                                                                 
  -------------                                          
  Konsole still launches the previously captured shell (e.g. zsh),              
  ignoring the new login shell.

  Expected result                                        
  ---------------                                                               
  An empty Command field should be persisted as "no override" and
  resolved dynamically via getpwuid() on every session start, so that           
  `chsh` changes are picked up without further user action.                     

  Suggested fixes                                                               
  ---------------                                                               
  - Treat an empty "Command" value as absent on serialization (do not
    write the `Command=` line at all when the field is empty).                  
  - And/or: at runtime, treat `Command=` with empty value as a synonym          
    for "no override" and fall back to getpwuid()->pw_shell, instead of         
    warning and capturing the current $SHELL.                                   
  - Consider adding an explicit "Use login shell from /etc/passwd"              
    checkbox in the profile UI for discoverability.                             

  Workaround                                                                    
  ----------                                                                    
  Edit ~/.local/share/konsole/<profile>.profile manually and remove the
  `Command=` line. As long as "Edit Current Profile" is not opened              
  again afterwards, Konsole respects the absent line and resolves the
  shell dynamically. Setting the file immutable with `chattr +i` blocks         
  re-writes but breaks GUI persistence of other settings.

  System                                                                        
  ------                                                 
  - Konsole:        26.04.1
  - Qt:             6.11.0                                                      
  - KDE Frameworks: 6.26.0                                                      
  - Plasma:         6.6.4                                                       
  - Kernel:         7.0.4 (xanmod1)                                             
  - Distribution:   Arch Linux (rolling) — using CachyOS repositories           
                    ([cachyos-v3], [cachyos-core-v3], [cachyos-extra-v3],       
                    [cachyos]) prepended over upstream Arch repos.              
                    Konsole package shipped from cachyos-extra-v3               
                    (x86_64-v3 rebuild of Arch's extra/konsole 26.04.1).        
                    This is *not* a CachyOS-installed system, so distro-        
                    specific patches/branding do not apply.                     
  - Login shell:    /usr/bin/zsh

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to