<commit_before>package main

import (
	"bufio"
	"flag"
	"fmt"
	"log"
	"os"
	"os/signal"
	"strings"
	"sync"
	"syscall"
)

var (
	errLogger = log.New(os.Stderr, "", 0)
)

func main() {
	flag.Parse()
	config := loadConfig()

	command := remoteCommand()

	sessions := openSessions(config)

	signals := make(chan os.Signal)
	signal.Notify(signals, syscall.SIGINT)

	var wg sync.WaitGroup
	done := make(chan bool)
loop:
	for {
		select {
		case <-signals:
			break loop
		case session, ok := <-sessions:
			if ok {
				defer session.Session.Close()
				host := session.Host
				err := requestPty(session.Session)
				if err != nil {
					errLogger.Print(prependHost(host, err.Error()))
					break
				}
				outScanner := initScanner(session)
				wg.Add(1)
				go runRemote(command, session, &wg)
				go output(host, outScanner)
			} else {
				go func() {
					wg.Wait()
					done <- true
				}()
				sessions = nil
			}
		case <-done:
			break loop
		}<commit_msg>print newline after interrupt is caught<commit_after>package main

import (
	"bufio"
	"flag"
	"fmt"
	"log"
	"os"
	"os/signal"
	"strings"
	"sync"
	"syscall"
)

var (
	errLogger = log.New(os.Stderr, "", 0)
)

func main() {
	flag.Parse()
	config := loadConfig()

	command := remoteCommand()

	sessions := openSessions(config)

	signals := make(chan os.Signal)
	signal.Notify(signals, syscall.SIGINT)

	var wg sync.WaitGroup
	done := make(chan bool)
loop:
	for {
		select {
		case <-signals:
			fmt.Println() // clean up for the next prompt
			break loop
		case session, ok := <-sessions:
			if ok {
				defer session.Session.Close()
				host := session.Host
				err := requestPty(session.Session)
				if err != nil {
					errLogger.Print(prependHost(host, err.Error()))
					break
				}
				outScanner := initScanner(session)
				wg.Add(1)
				go runRemote(command, session, &wg)
				go output(host, outScanner)
			} else {
				go func() {
					wg.Wait()
					done <- true
				}()
				sessions = nil
			}
		case <-done:
			break loop
		}
{'fraction_non_alphanumeric': 0.1430005017561465, 'fraction_numerical': 0.002007024586051179, 'mean_word_length': 2.8199233716475094, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6447084', 'n_tokens_mistral': 901, 'n_tokens_neox': 731, 'n_words': 178}