Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
24 additions
and
24 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,11 @@ | ||
package termenv | ||
|
||
import ( | ||
"fmt" | ||
) | ||
|
||
// Hyperlink creates a hyperlink using OSC8. | ||
func Hyperlink(link, name string) string { | ||
return output.Hyperlink(link, name) | ||
} | ||
|
||
// Hyperlink creates a hyperlink using OSC8. | ||
func (o *Output) Hyperlink(link, name string) string { | ||
return fmt.Sprintf("\x1b]8;;%s\x1b\\%s\x1b]8;;\x1b\\", link, name) | ||
return OSC + "8;;" + link + ST + name + OSC + "8;;" + ST | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,11 @@ | ||
package termenv | ||
|
||
import "fmt" | ||
|
||
// Notification triggers a notification using OSC777. | ||
func Notification(title, body string) { | ||
output.Notification(title, body) | ||
} | ||
|
||
// Notification triggers a notification using OSC777. | ||
func (o *Output) Notification(title, body string) { | ||
_, _ = o.WriteString(fmt.Sprintf(OSC+"777;notify;%s;%s\x1b\\", title, body)) | ||
_, _ = o.WriteString(OSC + "777;notify;" + title + ";" + body + ST) | ||
} |
This file contains 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
This file contains 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
This file contains 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