Skip to content

Commit

Permalink
Merge pull request #934 from yast/shell_command
Browse files Browse the repository at this point in the history
Expert console: use "dash" shell (bsc#1183648)
  • Loading branch information
lslezak committed Mar 18, 2021
2 parents 8272073 + 5650107 commit fdbead8
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
7 changes: 7 additions & 0 deletions package/yast2-installation.changes
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Wed Mar 17 16:53:42 UTC 2021 - Ladislav Slezák <lslezak@suse.cz>

- Expert console: use "dash" if available instead of "bash" shell
to avoid job control error messages (bsc#1183648)
- 4.3.35

-------------------------------------------------------------------
Thu Mar 11 15:13:16 UTC 2021 - Ladislav Slezák <lslezak@suse.cz>

Expand Down
2 changes: 1 addition & 1 deletion package/yast2-installation.spec
Expand Up @@ -16,7 +16,7 @@
#

Name: yast2-installation
Version: 4.3.34
Version: 4.3.35
Release: 0
Group: System/YaST
License: GPL-2.0-only
Expand Down
14 changes: 12 additions & 2 deletions src/lib/installation/console/plugins/shell_command.rb
Expand Up @@ -16,13 +16,23 @@ module Console
# define the "shell" command in the expert console
class Commands
def shell
system("/bin/bash")
# dash is a simple shell and needs less memory, also it does not complain
# about missing job control terminal
if File.exist?("/bin/dash")
system("/bin/dash")
# use full featured bash
elsif File.exist?("/bin/bash")
system("/bin/bash")
# fallback
else
system("/bin/sh")
end
end

private

def shell_description
"Starts a shell session (/bin/bash), use the \"exit\" command\n" \
"Starts a shell session, use the \"exit\" command\n" \
"or press Ctrl+D to return back to the YaST console"
end
end
Expand Down

0 comments on commit fdbead8

Please sign in to comment.