<commit_before>package window

import (
	"errors"
	"fmt"
	"net/url"
	"path/filepath"
	"time"

	"github.com/miketheprogrammer/go-thrust/lib/bindings/session"
	. "github.com/miketheprogrammer/go-thrust/lib/commands"
	. "github.com/miketheprogrammer/go-thrust/lib/common"
	"github.com/miketheprogrammer/go-thrust/lib/connection"
	"github.com/miketheprogrammer/go-thrust/lib/dispatcher"
	"github.com/miketheprogrammer/go-thrust/lib/events"
	"github.com/miketheprogrammer/go-thrust/lib/spawn"
)

type Window struct {
	TargetID         uint
	CommandHistory   []*Command
	ResponseHistory  []*CommandResponse
	WaitingResponses []*Command
	CommandQueue     []*Command
	Url              string
	Title            string
	Ready            bool
	Displayed        bool
	SendChannel      *connection.In `json:"-"`
}

func checkUrl(s string) (string, error) {
	u, err := url.Parse(s)
	if err != nil {
		return s, err
	}
	if u.Scheme == "" {
		p, err := filepath.Abs(s)
		if err != nil {
			return p, err
		}
		u = &url.URL{
			Scheme: "file",
			Path:   p,
		}<commit_msg>Bugfix in checkUrl<commit_after>package window

import (
	"errors"
	"fmt"
	"net/url"
	"path/filepath"
	"time"

	"github.com/miketheprogrammer/go-thrust/lib/bindings/session"
	. "github.com/miketheprogrammer/go-thrust/lib/commands"
	. "github.com/miketheprogrammer/go-thrust/lib/common"
	"github.com/miketheprogrammer/go-thrust/lib/connection"
	"github.com/miketheprogrammer/go-thrust/lib/dispatcher"
	"github.com/miketheprogrammer/go-thrust/lib/events"
	"github.com/miketheprogrammer/go-thrust/lib/spawn"
)

type Window struct {
	TargetID         uint
	CommandHistory   []*Command
	ResponseHistory  []*CommandResponse
	WaitingResponses []*Command
	CommandQueue     []*Command
	Url              string
	Title            string
	Ready            bool
	Displayed        bool
	SendChannel      *connection.In `json:"-"`
}

func checkUrl(s string) (string, error) {
	u, err := url.Parse(s)
	if err != nil {
		return s, err
	}
	if u.Scheme == "" {
		p, err := filepath.Abs(s)
		if err != nil {
			return s, err
		}
		u = &url.URL{
			Scheme: "file",
			Path:   p,
		}
{'fraction_non_alphanumeric': 0.1350968351440718, 'fraction_numerical': 0.0, 'mean_word_length': 3.0967117988394586, 'pattern_counts': {'":': 0, '<': 3, '<?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': '6318346', 'n_tokens_mistral': 828, 'n_tokens_neox': 799, 'n_words': 142}