···130130 apiClient := session.APIClient()
131131 dir := identity.DefaultDirectory()
132132133133+ // Save and Restore cursor position
134134+ fmt.Printf("\x1b7")
135135+ defer fmt.Printf("\x1b8")
136136+137137+ // Enter alternate buffer
138138+ fmt.Printf("\x1b[?1049h")
139139+ defer fmt.Printf("\x1b[?1049l")
140140+133141 // TODO: add a cli flag that allows us to resume from a specific cursor
134142 cursor := ""
135143 for {
···147155148156 cursor = *records.Cursor
149157150150- // TODO: Either put comments for what each of these do or create tiny little functions for them
151151- // Alternatively, I may want to find a terminal ui library and add other things like colors and bolded text
152152- fmt.Printf("\x1b[7")
153153- defer fmt.Printf("\x1b[8")
154154- fmt.Printf("\x1b[?1049h")
155155- defer fmt.Printf("\x1b[?1049l")
156156- fmt.Printf("\x1b[H")
157157-158158 for _, record := range records.Records {
159159+ // Clear the screen and move cursor home
160160+ fmt.Printf("\x1b[2J")
161161+ fmt.Printf("\x1b[H")
162162+159163 followRecord := record.Value.Val.(*bsky.GraphFollow)
160164 profileRecord, err := atproto.RepoGetRecord(ctx, apiClient,
161165 "",
···276280 goto user_input
277281 }
278282279279- fmt.Printf("\x1b[2J")
280280- fmt.Printf("\x1b[H")
281283 }
282284 }
283285}