ivaaaan / smug

Session manager and task runner for tmux. Start your development environment within one command.
MIT License
681 stars 27 forks source link

Name Conflict Resolution #80

Open ReiFan49 opened 2 years ago

ReiFan49 commented 2 years ago

Describe the bug If there are two or more smug config with name prefixed from one of them, and then the prefix of the name itself is running last (as it uses $(smug config)

To get the situation here:

However:

Smug config smug config does not matter

Expected behavior

Output of cat ~/.config/smug/smug.log output log does not matter.

Smug version 0.2.7

OS you're using Linux

ivaaaan commented 2 years ago

Hey. Can you provide more details on the expected behavior? I'm not sure I understand the issue. Also, what do you mean by smug config? There is no such command.

troke12 commented 2 years ago

Hey. Can you provide more details on the expected behavior? I'm not sure I understand the issue. Also, what do you mean by smug config? There is no such command.

He mean smug list might be typo

zmarta-atall commented 7 months ago

It seems I have the same problem, so I can try to explain it in a simple way. Let's say that we have two configuration files like these:

$cat aaa.yml 
session: testa

root: ~/

windows:
  - name: test
    commands:
      - true
$cat bbb.yml 
session: test

root: ~/

windows:
  - name: test
    commands:
      - true
$

If I start in this order

$smug start aaa
Starting a new session...
[detached (from session testa)]
$smug start bbb
Starting a new session...
[detached (from session testa)]
$

only aaa will start.

$
$tmux ls
testa: 1 windows (created Tue Jan 30 07:42:31 2024)
$

On the other hand, if I start in this order

$
$smug start bbb
Starting a new session...
[detached (from session test)]
$smug start aaa
Starting a new session...
[detached (from session testa)]
$

both will start.

$
$tmux ls
test: 1 windows (created Tue Jan 30 07:47:15 2024)
testa: 1 windows (created Tue Jan 30 07:47:23 2024)
$

I have done some testing and it seems to be related to the session names. In this case testmatches the beginning, or prefix, of testa.

I hope this clarifies the problem.