Skip to content

Commit

Permalink
ncurses fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
lslezak committed Feb 26, 2021
1 parent fb4aa26 commit 54aa5cf
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
20 changes: 13 additions & 7 deletions src/lib/installation/console_commands.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,21 @@ def configure(what = nil)
# would be displayed *below* the popup making it inaccessible :-(
return unless wizard_dialog?

puts "Starting the network configuration module..."
puts
puts "After it is finished (by pressing [Next]/[Back]/[Abort])"
puts "press Alt+Tab to get back to this console."

# wait a bit so the user can read the message above
sleep(5)
if Yast::UI.TextMode
Yast::UI.OpenUI
else
puts "Starting the network configuration module..."
puts
puts "After it is finished (by pressing [Next]/[Back]/[Abort])"
puts "press Alt+Tab to get back to this console."

# wait a bit so the user can read the message above
sleep(5)
end

Yast::WFM.call("inst_lan", [{ "skip_detection" => true }])

Yast::UI.CloseUI if Yast::UI.TextMode
else
puts "Error: Unknown option #{what}"
end
Expand Down
7 changes: 5 additions & 2 deletions src/lib/installation/console_tui.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# ------------------------------------------------------------------------------

require "yast"
require "shellwords"

Yast.import "UI"

Expand All @@ -27,13 +28,15 @@ def run(&block)
private

def start
@stty = `stty --save`.chomp
Yast::UI.CloseUI
# clear the terminal
system("clear")
end

def stop
system("stty #{Shellwords.escape(@stty)}")
Yast::UI.OpenUI

at_exit { system("stty onlcr echo") }
end
end
end

0 comments on commit 54aa5cf

Please sign in to comment.