Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Name Conflict Resolution #80

Open
ReiFan49 opened this issue Apr 23, 2022 · 3 comments
Open

Name Conflict Resolution #80

ReiFan49 opened this issue Apr 23, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@ReiFan49
Copy link

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:

  • Running a smug config will give you a list, with prefixer to come later from prefixed name.
    image
  • Executing whole batch using for VAR in $(smug config) will execute everything except the last one, due to prefixing issue. On the picture it's yohane-irc vs yohane which is shadowed by yohane-irc upon doing smug start yohane until the yohane-irc window got stopped.

However:

  • If I decide to smug config | sort, or at least sorting the naming order from smug config output, which happens to give different output from just smug config. Things works normally.
  • Execution order changed from yohane to yohane-irc instead vice versa. No naming conflict like what happened above.

Smug config
smug config does not matter

Expected behavior

  • Both yohane-irc and yohane should be executed alongside in any order of execution.

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

Smug version
0.2.7

OS you're using
Linux

@ReiFan49 ReiFan49 added the bug Something isn't working label Apr 23, 2022
@ivaaaan
Copy link
Owner

ivaaaan commented Jun 10, 2022

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
Copy link

troke12 commented Jun 17, 2022

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
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants