mirror of
https://github.com/daylinmorgan/tsm.git
synced 2024-12-22 13:10:43 -06:00
Compare commits
No commits in common. "3aa9fb9490426c1d60b93c888026a7a67cb53046" and "7a479425201ab3d3ff6c268f9bfdefa25eb0b531" have entirely different histories.
3aa9fb9490
...
7a47942520
2 changed files with 13 additions and 25 deletions
33
src/tsm.nim
33
src/tsm.nim
|
@ -1,9 +1,14 @@
|
||||||
import std/[sequtils, os]
|
import std/sequtils
|
||||||
import ./[selector, project, tmuxutils, term]
|
import ./[selector, project, tmuxutils]
|
||||||
import hwylterm, hwylterm/hwylcli
|
import hwylterm, hwylterm/hwylcli
|
||||||
|
|
||||||
proc tsm(project: Project) =
|
proc tsm(open: bool = false) =
|
||||||
if project.name notin tmux.sessions.mapIt(it.name):
|
let
|
||||||
|
projects = findProjects(open)
|
||||||
|
project = selectProject projects
|
||||||
|
selected = project.name
|
||||||
|
|
||||||
|
if selected notin tmux.sessions.mapIt(it.name):
|
||||||
tmux.new(project.name, project.location)
|
tmux.new(project.name, project.location)
|
||||||
else:
|
else:
|
||||||
tmux.attach project.name
|
tmux.attach project.name
|
||||||
|
@ -15,23 +20,7 @@ hwylCli:
|
||||||
name "tsm"
|
name "tsm"
|
||||||
V tsmVersion
|
V tsmVersion
|
||||||
flags:
|
flags:
|
||||||
open:
|
open "only search open sessions"
|
||||||
? "only search open sessions"
|
|
||||||
- o
|
|
||||||
new:
|
|
||||||
? "open session in current directory"
|
|
||||||
- n
|
|
||||||
run:
|
run:
|
||||||
if new and open:
|
tsm(open)
|
||||||
termQuit "--new and --open are mutually exclusive"
|
|
||||||
|
|
||||||
let project =
|
|
||||||
if new: newProject(
|
|
||||||
path = getCurrentDir(),
|
|
||||||
open = false,
|
|
||||||
)
|
|
||||||
else:
|
|
||||||
selectProject findProjects(open)
|
|
||||||
|
|
||||||
tsm(project)
|
|
||||||
|
|
||||||
|
|
5
todo.md
5
todo.md
|
@ -1,8 +1,7 @@
|
||||||
# tsm todo's
|
# tsm todo's
|
||||||
|
|
||||||
- [x] add message about new keybind Ctrl+E
|
- [x] add message about new keybind Ctrl+E
|
||||||
- [x] add open session info as faint text -> "session: 2 windows (created ......)"
|
- [-] add open session info as faint text -> "session: 2 windows (created ......)"
|
||||||
- [x] include this info for the configured but open sessions too
|
- include this info for the configured but open sessions too
|
||||||
- [ ] add `-n,--new` flag to emulate `Ctrl+E` behavior
|
|
||||||
|
|
||||||
<!-- generated with <3 by daylinmorgan/todo -->
|
<!-- generated with <3 by daylinmorgan/todo -->
|
||||||
|
|
Loading…
Reference in a new issue