forked from sst/sst
-
Notifications
You must be signed in to change notification settings - Fork 0
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
36 changed files
with
3,704 additions
and
520 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,3 +10,4 @@ Pulumi.yaml | |
# Local Netlify folder | ||
.netlify | ||
.env | ||
tmp |
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package main | ||
|
||
import ( | ||
"context" | ||
"time" | ||
|
||
"github.com/sst/ion/cmd/sst/mosaic/multiplexer2/switcher" | ||
) | ||
|
||
func main() { | ||
// make raw | ||
ctx := context.Background() | ||
s := switcher.New(ctx) | ||
s.AddProcess("1", []string{"/home/thdxr/dev/projects/sst/ion/dist/sst", "dev"}, "sst", "", false) | ||
s.AddProcess("2", []string{"zsh"}, "shell", "", true) | ||
s.AddProcess("3", []string{"ping", "google.com"}, "ping", "", true) | ||
time.Sleep(time.Second * 10) | ||
s.Shutdown() | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package ecma48 | ||
|
||
import ( | ||
"fmt" | ||
) | ||
|
||
// Formats into ANSI escape code | ||
func (c *Color) ToANSI(bg bool) string { | ||
var offset int32 | ||
if bg { | ||
offset = 10 | ||
} else { | ||
offset = 0 | ||
} | ||
|
||
switch c.ColorMode { | ||
case ColorNone: | ||
return fmt.Sprintf("\033[%dm", 39+offset) | ||
case ColorBit3Normal: | ||
return fmt.Sprintf("\033[%dm", 30+offset+c.Code) | ||
case ColorBit3Bright: | ||
return fmt.Sprintf("\033[%dm", 90+offset+c.Code) | ||
case ColorBit8: | ||
return fmt.Sprintf("\033[%d;5;%dm", 38+offset, c.Code) | ||
case ColorBit24: | ||
return fmt.Sprintf( | ||
"\033[%d;2;%d;%d;%dm", 38+offset, | ||
(c.Code>>16)&0xff, (c.Code>>8)&0xff, c.Code&0xff, | ||
) | ||
default: | ||
panic(fmt.Sprintf("Unexpected ColorMode: %v", c.ColorMode)) | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,196 @@ | ||
package ecma48 | ||
|
||
// Output is the output of the parser | ||
type Output struct { | ||
Raw []rune | ||
Parsed | ||
} | ||
|
||
// Parsed could be a simple character or maybe an escape sequence | ||
type Parsed interface { | ||
// Debug() string | ||
// Raw() []byte | ||
} | ||
|
||
type EOF struct{} | ||
|
||
// Unrecognized is when we don't understand the input | ||
type Unrecognized string | ||
|
||
type Esc struct{} | ||
|
||
// Char is a single character that may occupy multiple cells | ||
type Char struct { | ||
Rune rune | ||
IsWide bool | ||
} | ||
|
||
type OSCCursorQuery struct{} | ||
|
||
// CtrlChar is for ctrl+[character] | ||
type CtrlChar struct { | ||
Char rune | ||
} | ||
|
||
// AltChar is for alt+[character] | ||
type AltChar struct { | ||
Char rune | ||
} | ||
|
||
// AltShiftChar is for alt+shift+[character] | ||
type AltShiftChar struct { | ||
Char rune | ||
} | ||
|
||
// Tab ('\t') | ||
type Tab struct{} | ||
|
||
// Newline ('\n') | ||
type Newline struct{} | ||
|
||
// CarriageReturn ('\r') | ||
type CarriageReturn struct{} | ||
|
||
// Backspace ('\b') | ||
type Backspace struct{} | ||
|
||
// Delete (0x7F) | ||
type Delete struct{} | ||
|
||
// CursorMovement is possibly caused by an arrow key | ||
type CursorMovement struct { | ||
Direction | ||
N int | ||
|
||
Alt bool | ||
Shift bool | ||
Ctrl bool | ||
} | ||
|
||
// RI (Reverse Index) | ||
type RI struct{} | ||
|
||
// PrivateDEC is DECSET/DECRST (DEC Private Mode Set/Reset) | ||
type PrivateDEC struct { | ||
On bool | ||
Code int | ||
} | ||
|
||
// VPA (Vertical Line Position Absolute) | ||
type VPA struct { | ||
Y int | ||
} | ||
|
||
// CNL (Cursor Next Line) | ||
type CNL struct { | ||
YDiff uint | ||
} | ||
|
||
// CPL (Cursor Previous Line) | ||
type CPL struct { | ||
YDiff uint | ||
} | ||
|
||
// CHA (Cursor Horizontal Absolute) | ||
type CHA struct { | ||
X int | ||
} | ||
|
||
// CUP (Cursor Position) | ||
type CUP struct { | ||
X int | ||
Y int | ||
} | ||
|
||
// ED (Erase in Display) | ||
type ED struct { | ||
Directive int | ||
} | ||
|
||
// EL (Erase in Line) | ||
type EL struct { | ||
Directive int | ||
} | ||
|
||
// ECH (Erase Characters) | ||
type ECH struct { | ||
N int | ||
} | ||
|
||
// IL (Insert Lines) | ||
type IL struct { | ||
N int | ||
} | ||
|
||
// ICH (Insert Characters) | ||
type ICH struct { | ||
N int | ||
} | ||
|
||
// DL (Delete Lines) | ||
type DL struct { | ||
N int | ||
} | ||
|
||
// DCH (Delete Characters) | ||
type DCH struct { | ||
N int | ||
} | ||
|
||
// DECSTBM (Set Scrolling Region). Bottom is -1 if it should be the bottom of the screen | ||
type DECSTBM struct { | ||
Top int | ||
Bottom int | ||
} | ||
|
||
// SU (Scroll Up) | ||
type SU struct { | ||
N uint | ||
} | ||
|
||
// SD (Scroll Down) | ||
type SD struct { | ||
N uint | ||
} | ||
|
||
// SCOSC (Save Cursor Position) | ||
type SCOSC struct{} | ||
|
||
// SCORC (Restore Cursor Position) | ||
type SCORC struct{} | ||
|
||
type StyleReset struct{} | ||
|
||
type StyleBold bool | ||
|
||
type StyleConceal bool | ||
|
||
type StyleCrossedOut bool | ||
|
||
type StyleItalic bool | ||
|
||
type StyleUnderline bool | ||
|
||
type StyleFaint bool | ||
|
||
type StyleReverse bool | ||
|
||
type StyleForeground Color | ||
|
||
type StyleBackground Color | ||
|
||
type ScrollDown int | ||
|
||
type ScrollUp int | ||
|
||
type MouseDown struct { | ||
X, Y int | ||
} | ||
|
||
type MouseUp struct { | ||
X, Y int | ||
} | ||
|
||
type MouseDrag struct { | ||
X, Y int | ||
} |
Oops, something went wrong.