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

Segmentation fault when setting tmux pane title #846

Closed
naggie opened this issue May 30, 2013 · 4 comments
Closed

Segmentation fault when setting tmux pane title #846

naggie opened this issue May 30, 2013 · 4 comments
Milestone

Comments

@naggie
Copy link

naggie commented May 30, 2013

Using the command printf "\\033k%s\\033\\\\" title_goes_here causes a segmentation fault if called from within fish_prompt.

I know that's not the best way of setting the tmux title. I have now done it properly with a hook on PWD variable change, which worked around it: https://github.com/naggie/dotfiles/commit/23467225fcaf4d06f9aa01d9121bb7620da5a7dc

Even though this is not correct use of fish, it might reveal the underlying cause.

I can replicate this on Mac OS X Mountain lion + fish 2.0.0 and Ubuntu 12.04 (64-bit) + fish 2.0.0
.
Thanks for developing fish. It's amazing!

@ridiculousfish
Copy link
Member

Wow, nice find!

@ridiculousfish
Copy link
Member

(lldb) bt
* thread #1: tid = 0x1c03, 0x00007fff935f9fe6 libsystem_c.dylib`wcslen + 4, stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
    frame #0: 0x00007fff935f9fe6 libsystem_c.dylib`wcslen + 4
    frame #1: 0x00007fff927a4c58 libstdc++.6.dylib`std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::compare(wchar_t const*) const + 32
    frame #2: 0x000000010002ebfd lfish`bool std::operator==<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >(__lhs=0x0000000000000000, __rhs=0x00007fff5fbfe860) + 29 at basic_string.h:2165
    frame #3: 0x000000010002da21 lfish`calc_prompt_layout(prompt=0x00000001010021c8) + 1409 at screen.cpp:292
    frame #4: 0x000000010002b85a lfish`compute_layout(s=0x000000010020dd18, screen_width=80, left_prompt_str=0x000000010020e068, right_prompt_str=0x000000010020e070, commandline=0x00007fff5fbfec70, autosuggestion_str=0x00007fff5fbfec68, indent=0x0000000101000950) + 186 at screen.cpp:1070
    frame #5: 0x000000010002b2e5 lfish`s_write(s=0x000000010020dd18, left_prompt=0x000000010020e068, right_prompt=0x000000010020e070, commandline=0x00007fff5fbfed68, explicit_len=0, colors=0x0000000101002090, indent=0x0000000101000950, cursor_pos=0) + 549 at screen.cpp:1246
    frame #6: 0x00000001000a2cb4 lfish`reader_repaint() + 452 at reader.cpp:532
    frame #7: 0x00000001000a4b8d lfish`reader_readline() + 205 at reader.cpp:2858
    frame #8: 0x00000001000a8e69 lfish`read_i() + 585 at reader.cpp:2740
    frame #9: 0x00000001000a8bbe lfish`reader_read(fd=0, io=0x00007fff5fbff8e0) + 94 at reader.cpp:3764
    frame #10: 0x00000001000c9eec lfish`main(argc=1, argv=0x00007fff5fbff980) + 668 at fish.cpp:485
    frame #11: 0x0000000100001554 lfish`start + 52

@ridiculousfish
Copy link
Member

Fixed as 220e1e8
Thanks for reporting this!

@naggie
Copy link
Author

naggie commented Jun 2, 2013

No problem :)
That was fast, cheers

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants