Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ members = [".", "plugins/nightcrow-recovery"]

[package]
name = "nightcrow"
version = "0.1.0"
version = "0.1.1"
edition = "2024"
description = "Agent-adjacent terminal workbench — git diff viewer + multi-terminal panes for running CLIs next to your code"
license = "Apache-2.0"
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ routes are in [Getting started](docs/getting-started.md#install).
## Quick start

```bash
# The one-command way in: background the session and attach the TUI to it.
# If a session is already running, it attaches to that one instead of
# starting a second. It reopens the repositories from last time.
nightcrow -d attach
# The one-command way in: attach the TUI, starting a backgrounded session
# first if none is running. If one already is, it attaches to that one
# instead of starting a second. It reopens the repositories from last time.
nightcrow attach
```

The pieces on their own, when you want them separately:
Expand All @@ -47,7 +47,7 @@ The pieces on their own, when you want them separately:
nightcrow -d

# From another terminal: bring up the TUI on that session.
nightcrow attach
nightcrow attach # same command — it attaches to the session already running

# Foreground, for a service manager or to watch the startup output.
nightcrow
Expand Down
9 changes: 5 additions & 4 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@ terminals, and you reach it from a terminal (`nightcrow attach`) or a browser.
Closing a client leaves the session running.

```bash
# The usual way in: start the session in the background and attach the TUI.
# An already-running session is attached to as-is, not duplicated.
nightcrow -d attach
# The usual way in: attach the TUI, starting a backgrounded session first if
# none is running. An already-running session is attached to as-is, not
# duplicated.
nightcrow attach

# Start the session. Runs in the foreground until you stop it (Ctrl-C).
# It reopens the repositories from last time — nothing, on a first run.
Expand All @@ -42,7 +43,7 @@ nightcrow
# ...or run it in the background and get your shell back.
nightcrow -d

# From another terminal: bring up the TUI on that session.
# From another terminal: bring up the TUI on that session (same command).
nightcrow attach

# Launch terminal panes running commands at startup (repeatable)
Expand Down
2 changes: 1 addition & 1 deletion plugins/nightcrow-recovery/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "nightcrow-recovery"
version = "0.1.0"
version = "0.1.1"
edition = "2024"
description = "nightcrow plugin: notices a coding CLI hit its usage limit and resumes it when the limit resets"
license = "Apache-2.0"
Expand Down
9 changes: 5 additions & 4 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ pub(crate) struct Cli {
/// A service manager should start nightcrow *without* this — backgrounding
/// is what it does itself.
///
/// With `attach`, this starts the session if none is running and then
/// attaches to it.
/// With `attach` it makes no difference: attaching starts a backgrounded
/// session on its own when none is running.
#[arg(short, long)]
pub(crate) detach: bool,

Expand All @@ -56,13 +56,14 @@ pub(crate) enum Commands {
#[arg(long)]
force: bool,
},
/// Attach the TUI to a running nightcrow daemon.
/// Attach the TUI to the nightcrow session, starting one if none is running.
///
/// The session — which repositories are open, and in what order — belongs
/// to the daemon, so this starts on whatever it is serving. Leaving does
/// not end the session.
///
/// Requires a running daemon; pass `-d` to start one first if none is.
/// A session started this way runs in the background, so it outlives the
/// TUI that caused it to exist.
Attach,
/// Manage plugin executables in ~/.nightcrow/plugins.
///
Expand Down
9 changes: 6 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,12 @@ fn main() -> Result<()> {
let cli = Cli::parse();
match cli.command {
Some(Commands::Init { force }) => run_init(force),
// `-d` with `attach` means "start one if there isn't one, then attach".
Some(Commands::Attach) if cli.detach => run_attach_detached(),
Some(Commands::Attach) => application::attach::run_attach(),
// Attach starts a session when none is running, with or without `-d`:
// the first command of the day should not have to be two commands, and
// a session that has to exist for the TUI to draw is not a choice the
// user was making. `-d` still says how the session runs — in the
// background — which is what it already does here.
Some(Commands::Attach) => run_attach_detached(),
Some(Commands::Plugin { command }) => cli::plugin_cmd::run_plugin(command),
Some(Commands::Stop { socket }) => run_stop(socket),
None => run_daemon(cli.exec, cli.port, cli.bind, cli.detach),
Expand Down
4 changes: 3 additions & 1 deletion src/session/terminal/tests/reattach.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,11 @@ fn pane_running(sequences: &str) -> Running {
next_matching(&session, |f| created_pane(f).is_some()).expect("no created message");
let pane = created_pane(&created).unwrap();

// Ubuntu's `/etc/bash.bashrc` puts an OSC title in `PS1`, so every prompt
// redraw would overwrite whatever `sequences` set the pane's title to.
session.dispatch(ClientMessage::Input {
pane,
data: sequences.to_string(),
data: format!("PS1='$ '\nunset PROMPT_COMMAND\n{sequences}"),
});
// The tracker only knows what it has seen, so the assertions have to wait
// for the program's own bytes to come back.
Expand Down
1 change: 1 addition & 0 deletions viewer-ui/dist/assets/Html-BhYYcoAd.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion viewer-ui/dist/assets/Html-zHO_NJ4V.js

This file was deleted.

35 changes: 0 additions & 35 deletions viewer-ui/dist/assets/Markdown-2Bzukzd-.js

This file was deleted.

35 changes: 35 additions & 0 deletions viewer-ui/dist/assets/Markdown-BSt8Yj5Z.js

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 35 additions & 0 deletions viewer-ui/dist/assets/Terminal-BCQTzfIs.js

Large diffs are not rendered by default.

9 changes: 0 additions & 9 deletions viewer-ui/dist/assets/Terminal-CrC-2OEq.js

This file was deleted.

2 changes: 2 additions & 0 deletions viewer-ui/dist/assets/index-B8P4pMZy.css

Large diffs are not rendered by default.

11 changes: 0 additions & 11 deletions viewer-ui/dist/assets/index-CVyd7CZ2.js

This file was deleted.

1 change: 0 additions & 1 deletion viewer-ui/dist/assets/index-DaeGo1E5.css

This file was deleted.

11 changes: 11 additions & 0 deletions viewer-ui/dist/assets/index-DtNEx9Qt.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions viewer-ui/dist/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions viewer-ui/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion viewer-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "nightcrow-viewer-ui",
"private": true,
"version": "0.1.0",
"version": "0.1.1",
"type": "module",
"scripts": {
"dev": "vite",
Expand Down