Created
September 9, 2022 17:35
-
-
Save jbadger3/2b2da6dde839bb88db36c2e472eff621 to your computer and use it in GitHub Desktop.
on_command_line_applications_in_swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
import Terminus | |
let terminal = Terminal.shared | |
var attributedString = AttributedString("Hello, bold, underlined, world.") | |
if let boldRange = attributedString.range(of: "bold") { | |
attributedString[boldRange].terminalTextAttributes = [.bold] | |
} | |
if let underlinedRange = attributedString.range(of: "underlined") { | |
attributedString[underlinedRange].terminalTextAttributes = [.underline] | |
} | |
terminal.write(attributedString: attributedString) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment