-
Notifications
You must be signed in to change notification settings - Fork 0
/
2019-03-16-000-til--prompt-matters-to-org-mode.html
45 lines (41 loc) · 2.97 KB
/
2019-03-16-000-til--prompt-matters-to-org-mode.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="alternate"
type="application/rss+xml"
href="https://magnus.therning.org/feed.xml"
title="RSS feed for https://magnus.therning.org/">
<title>TIL: prompt matters to org-mode</title>
<meta name="author" content="Magnus Therning"><meta name="referrer" content="no-referrer"><link href= "static/style.css" rel="stylesheet" type="text/css" /><link href= "static/htmlize.css" rel="stylesheet" type="text/css" /><link href= "static/extra_style.css" rel="stylesheet" type="text/css" /></head>
<body>
<div id="preamble" class="status"><div class="nav-bar"><a class="nav-link" href="./index.html">Top</a><a class="nav-link" href="./archive.html">Archive</a><a class="nav-link align-right" href="./feed.xml"><img src="static/rss-feed-icon.png" style="height: 24px;" /></a></div></div>
<div id="content">
<div class="post-date">16 Mar 2019</div><h1 class="post-title"><a href="https://magnus.therning.org/2019-03-16-000-til--prompt-matters-to-org-mode.html">TIL: prompt matters to org-mode</a></h1>
<p>
A workmate just embellished some shell code blocks I'd put in a shared <a href="https://orgmode.org/">org-mode</a>
file with <code>:session s</code>. When I tried to run the blocks with sessions my emacs
just froze up though. I found a <a href="https://emacs.stackexchange.com/questions/19735/emacs-freezes-with-any-org-babel-snippet-using-session">post on the emacs StackExchange</a> that offered a
possible cause for it: the prompt.
</p>
<p>
I'm using <a href="https://github.com/Bash-it/bash-it">bash-it</a> so my prompt is rather far from the default.
</p>
<p>
After inspecting the session buffer simply added the following to my <code>~/.bashrc</code>
</p>
<div class="org-src-container">
<pre class="src src-shell"><span class="org-keyword">if</span> <span class="org-rainbow-delimiters-depth-1">[</span><span class="org-rainbow-delimiters-depth-2">[</span> $<span class="org-rainbow-delimiters-depth-3">{</span><span class="org-variable-name">TERM</span><span class="org-rainbow-delimiters-depth-3">}</span> == <span class="org-string">"dumb"</span> <span class="org-rainbow-delimiters-depth-2">]</span><span class="org-rainbow-delimiters-depth-1">]</span>; <span class="org-keyword">then</span>
<span class="org-builtin">export</span> <span class="org-variable-name">BASH_IT_THEME</span>=<span class="org-string">'standard'</span>
<span class="org-keyword">else</span>
<span class="org-builtin">export</span> <span class="org-variable-name">BASH_IT_THEME</span>=<span class="org-string">'simple'</span>
<span class="org-keyword">fi</span>
</pre>
</div>
<p>
and now I can finally run shell code blocks in sessions.
</p>
<div class="taglist"><a href="https://magnus.therning.org/tags.html">Tags</a>: <a href="https://magnus.therning.org/tag-emacs.html">emacs</a> <a href="https://magnus.therning.org/tag-org-mode.html">org-mode</a> </div></div>
<div id="postamble" class="status"><!-- org-static-blog-page-postamble --></div>
</body>
</html>