session

package
v1.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 18, 2026 License: MIT Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package session makes and finds the dated markdown files that the start screen's New Session and Last Session open: one file a day, named for the date, in a sessions folder.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultDir

func DefaultDir(home string) string

DefaultDir is the sessions folder when none is set, under home.

func Dir

func Dir(folder, home string) string

Dir is the sessions folder: folder, with a leading ~ for home, or DefaultDir when folder is "".

func Last

func Last(dir string) (string, error)

Last is the markdown file in dir changed last, or "" if dir has none or isn't there. Files in folders under dir aren't looked at.

func LoginShell

func LoginShell(getenv func(string) string) string

LoginShell is the shell a new session's blocks run in: $SHELL, as environ has it, when it is zsh or bash, so the History pane is the shell you use and reads its rc file. Otherwise it is "", for the default /bin/sh, since mdsh runs only sh-like shells.

func Name

func Name(day time.Time) string

Name is the file name of day's session, such as 2026-11-02.md.

func Today

func Today(dir, template, shell string, now time.Time) (file string, made bool, err error)

Today is the path of the session for now's day in dir. If it isn't there it is made, with dir, as a copy of template, or a heading for the date when template is "", under front matter that sets the shell to shell unless shell is "". It reports whether it made the file; a file already there is left as it is.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL